Skip to content

Commit

Permalink
When initiating the TLS connection use tls_server.
Browse files Browse the repository at this point in the history
Conflicts:
	src/filed/authenticate.c
  • Loading branch information
Marco van Wieringen authored and pstorz committed Feb 20, 2015
1 parent 502145b commit 67ba3e3
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/filed/authenticate.c
Expand Up @@ -327,16 +327,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;
}
}

/*
* Engage TLS! Full Speed Ahead!
*/
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 67ba3e3

Please sign in to comment.