- btimer_t *tid = start_bsock_timer(sd, AUTH_TIMEOUT);
- auth_success = cram_md5_get_auth(sd, jcr->sd_auth_key, &tls_remote_need);
+ if (me->tls_authenticate) {
+ tls_local_need = BNET_TLS_REQUIRED;
+ }
+
+ if (job_canceled(jcr)) {
+ auth_success = false; /* force quick exit */
+ goto auth_fatal;
+ }
+
+ /* Respond to SD challenge */
+ auth_success = cram_md5_respond(sd, jcr->sd_auth_key, &tls_remote_need, &compatible);
+ if (job_canceled(jcr)) {
+ auth_success = false; /* force quick exit */
+ goto auth_fatal;
+ }