X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/e65127948dd214fcfc807d2ff15f871aaf5904e1..83ffa51bdfbcf4e1f93e57fb64d57ddbeeeb2304:/uip/popsbr.c diff --git a/uip/popsbr.c b/uip/popsbr.c index 638fa411..70d71044 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -146,14 +146,6 @@ pop_init (char *host, char *port, char *user, char *pass, char *proxy, if (user) netsec_set_userid(nsc, user); - if (tls) { - if (netsec_set_tls(nsc, 1, &errstr) != OK) { - snprintf(response, sizeof(response), "%s", errstr); - free(errstr); - return NOTOK; - } - } - if (oauth_svc != NULL) { if (netsec_set_oauth_service(nsc, oauth_svc) != OK) { snprintf(response, sizeof(response), "OAuth2 not supported"); @@ -222,6 +214,12 @@ pop_init (char *host, char *port, char *user, char *pass, char *proxy, netsec_set_snoop(nsc, snoop); if (tls) { + if (netsec_set_tls(nsc, 1, &errstr) != OK) { + snprintf(response, sizeof(response), "%s", errstr); + free(errstr); + return NOTOK; + } + if (netsec_negotiate_tls(nsc, &errstr) != OK) { snprintf(response, sizeof(response), "%s", errstr); free(errstr);