BUG/MINOR: lua: Fix SSL initialisation
This new initialisation mode for the SSL make easiest the arguments
declaration. In other way, this patch fix a bug in the SSL
initialisation.
diff --git a/src/hlua.c b/src/hlua.c
index c6a4447..82058d8 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -4536,10 +4536,16 @@
struct sample_conv *sc;
char *p;
#ifdef USE_OPENSSL
- char *args[4];
struct srv_kw *kw;
int tmp_error;
char *error;
+ char *args[] = { /* SSL client configuration. */
+ "ssl",
+ "verify",
+ "none",
+ "force-sslv3",
+ NULL
+ };
#endif
/* Initialise com signals pool session. */
@@ -4940,14 +4946,10 @@
socket_ssl.agent.health = socket_ssl.agent.rise; /* socket, but will fall down at first failure */
socket_ssl.agent.server = &socket_ssl;
- socket_ssl.xprt = &raw_sock;
+ socket_ssl.use_ssl = 1;
+ socket_ssl.xprt = &ssl_sock;
- args[0] = "ssl";
- args[1] = "verify";
- args[2] = "none";
- args[3] = NULL;
-
- for (idx = 0; idx < 3; idx++) {
+ for (idx = 0; args[idx] != NULL; idx++) {
if ((kw = srv_find_kw(args[idx])) != NULL) { /* Maybe it's registered server keyword */
/*
*
@@ -4967,9 +4969,6 @@
}
/* Initialize SSL server. */
- if (socket_ssl.xprt == &ssl_sock) {
- socket_ssl.use_ssl = 1;
- ssl_sock_prepare_srv_ctx(&socket_ssl, &socket_proxy);
- }
+ ssl_sock_prepare_srv_ctx(&socket_ssl, &socket_proxy);
#endif
}