*dfpp = open_socket(lsa);
#if ENABLE_FEATURE_WGET_HTTPS
- /* "PROT P" enables encryption of data stream.
- * Without it (or with "PROT C"), data is sent unencrypted.
- */
- if (ftpcmd("PROT P", NULL, sfp) == 200)
- spawn_ssl_client(target->host, fileno(*dfpp), /*flags*/ 0);
+ if (target->protocol == P_FTPS) {
+ /* "PROT P" enables encryption of data stream.
+ * Without it (or with "PROT C"), data is sent unencrypted.
+ */
+ if (ftpcmd("PROT P", NULL, sfp) == 200)
+ spawn_ssl_client(target->host, fileno(*dfpp), /*flags*/ 0);
+ }
#endif
if (G.beg_range != 0) {