How to use a Client Certificate with ftp_ssl_conne

2019-05-30 03:17发布

问题:

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!

回答1:

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



标签: php ssl ftps