Skip to content

Commit

Permalink
When initiating the TLS connection use tls_server.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed Feb 17, 2015
1 parent 441f73f commit 773aa2b
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/filed/authenticate.c
Expand Up @@ -332,13 +332,19 @@ static inline bool two_way_authenticate(BSOCK *bs, JCR *jcr, bool initiate, cons
*/
if (initiate) {
verify_list = me->tls_allowed_cns;
if (!bnet_tls_server(me->tls_ctx, bs, verify_list)) {
Jmsg(jcr, M_FATAL, 0, _("TLS negotiation failed.\n"));
auth_success = false;
goto auth_fatal;
}
} else {
if (!bnet_tls_client(me->tls_ctx, bs, verify_list)) {
Jmsg(jcr, M_FATAL, 0, _("TLS negotiation failed.\n"));
auth_success = false;
goto auth_fatal;
}
}

if (!bnet_tls_client(me->tls_ctx, bs, verify_list)) {
Jmsg(jcr, M_FATAL, 0, _("TLS negotiation failed.\n"));
auth_success = false;
goto auth_fatal;
}
if (me->tls_authenticate) { /* tls authentication only? */
bs->free_tls(); /* yes, shutdown tls */
}
Expand Down

0 comments on commit 773aa2b

Please sign in to comment.