#endif
#endif
- /*
- * OpenSSL will automatically create certificate chains,
- * unless we tell it to not do that. The problem is that
- * it sometimes gets the chains right from a certificate
- * signature view, but wrong from the clients view.
- */
- if (!conf->auto_chain) {
- SSL_CTX_set_mode(ctx, SSL_MODE_NO_AUTO_CHAIN);
+ {
+ int mode = 0;
+
+ /*
+ * OpenSSL will automatically create certificate chains,
+ * unless we tell it to not do that. The problem is that
+ * it sometimes gets the chains right from a certificate
+ * signature view, but wrong from the clients view.
+ */
+ if (!conf->auto_chain) mode |= SSL_MODE_NO_AUTO_CHAIN;
+
+ if (client) {
+ mode |= SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER;
+ mode |= SSL_MODE_AUTO_RETRY;
+ }
+ SSL_CTX_set_mode(ctx, mode);
}
/* Set Info callback */
session->ctx = conf->ctx[(conf->ctx_count == 1) ? 0 : conf->ctx_next++ % conf->ctx_count]; /* mutex not needed */
rad_assert(session->ctx);
- SSL_CTX_set_mode(session->ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER | SSL_MODE_AUTO_RETRY);
-
session->ssl = SSL_new(session->ctx);
if (!session->ssl) {
talloc_free(session);