#include <proto/task.h>
#include <proto/tcp_rules.h>
-#ifdef USE_OPENSSL
-#include <types/ssl_sock.h>
-#include <proto/ssl_sock.h>
-#include <proto/shctx.h>
-#endif /*USE_OPENSSL */
/* This is the SSLv3 CLIENT HELLO packet used in conjunction with the
* ssl-hello-chk option to ensure that the remote server speaks SSL.
newsrv->minconn = newsrv->maxconn;
}
-#ifdef USE_OPENSSL
- if (newsrv->use_ssl || newsrv->check.use_ssl)
- cfgerr += ssl_sock_prepare_srv_ctx(newsrv);
-#endif /* USE_OPENSSL */
+ /* this will also properly set the transport layer for prod and checks */
+ if (newsrv->use_ssl || newsrv->check.use_ssl) {
+ if (xprt_get(XPRT_SSL) && xprt_get(XPRT_SSL)->prepare_srv)
+ cfgerr += xprt_get(XPRT_SSL)->prepare_srv(newsrv);
+ }
/* set the check type on the server */
newsrv->check.type = curproxy->options2 & PR_O2_CHK_ANY;
free(s->agent.bo);
free(s->agent.send_string);
free((char*)s->conf.file);
-#ifdef USE_OPENSSL
- if (s->use_ssl || s->check.use_ssl)
- ssl_sock_free_srv_ctx(s);
-#endif
+
+ if (s->use_ssl || s->check.use_ssl) {
+ if (xprt_get(XPRT_SSL) && xprt_get(XPRT_SSL)->destroy_srv)
+ xprt_get(XPRT_SSL)->destroy_srv(s);
+ }
free(s);
s = s_next;
}/* end while(s) */
#include <proto/server.h>
#include <proto/session.h>
#include <proto/stream.h>
-#include <proto/ssl_sock.h>
#include <proto/stream_interface.h>
#include <proto/task.h>
#include <proto/tcp_rules.h>
}
/* Initialize SSL server. */
- ssl_sock_prepare_srv_ctx(&socket_ssl);
+ if (socket_ssl.xprt->prepare_srv)
+ socket_ssl.xprt->prepare_srv(&socket_ssl);
#endif
RESET_SAFE_LJMP(gL.T);
.init = ssl_sock_init,
.prepare_bind_conf = ssl_sock_prepare_bind_conf,
.destroy_bind_conf = ssl_sock_destroy_bind_conf,
+ .prepare_srv = ssl_sock_prepare_srv_ctx,
+ .destroy_srv = ssl_sock_free_srv_ctx,
.name = "SSL",
};