What are the differences between Open SSL and Auth SSL in the context of PHP FTP connections?

When establishing FTP connections in PHP, Open SSL and Auth SSL are two different methods for securing the connection. Open SSL uses the OpenSSL library to encrypt the data being transferred over the FTP connection, while Auth SSL is a method that requires the server to authenticate itself before the connection is established. To use Open SSL in PHP FTP connections, you can simply enable the OpenSSL extension in your PHP configuration. On the other hand, to use Auth SSL, you need to explicitly set the FTP_SSL constant to the value FTP_SSL_AUTH.

// Using Open SSL in PHP FTP connection
$ftp = ftp_ssl_connect('ftp.example.com');
if ($ftp) {
    // Perform FTP operations
    ftp_login($ftp, 'username', 'password');
    ftp_pasv($ftp, true);
    // Close the FTP connection
    ftp_close($ftp);
}

// Using Auth SSL in PHP FTP connection
$ftp = ftp_ssl_connect('ftp.example.com', 21, 30);
if ($ftp) {
    ftp_set_option($ftp, FTP_SSL, FTP_SSL_AUTH);
    // Perform FTP operations
    ftp_login($ftp, 'username', 'password');
    ftp_pasv($ftp, true);
    // Close the FTP connection
    ftp_close($ftp);
}