问题
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
.
来源:https://stackoverflow.com/questions/4027712/how-to-use-a-client-certificate-with-ftp-ssl-connect