2

I'm looking for the best method to work with an FTP server over an SSL connection. (Generally, pushing a file up as well as getting a list of files on the server). One requirement for this project is that I must use a client side X.509 certificate as part of the authentication process.

Can I use a client certificate using the php function ftp_ssl_connect. If so, how? The only other option I've been able to identify would be using curl to work via FTPS.

Any suggestions or thoughts would be greatly appreciated!

Adam
  • 632
  • 7
  • 9

1 Answers1

0

You could use PHP's stream context functions which allow setting SSL client certificates. Use the created context with standard functions like fopen.

cweiske
  • 30,033
  • 14
  • 133
  • 194
  • Unfortunately these open a new connection for every file operation you do. There is no way to save a connection handler and reusing this multiple times to prevent drowning the server in connection attempts. – Sfynx Mar 22 '13 at 14:04