mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 23:56:57 +02:00
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.
This commit is contained in:
parent
c798b5d282
commit
36d1374484
23
src/hlua.c
23
src/hlua.c
@ -4536,10 +4536,16 @@ void hlua_init(void)
|
|||||||
struct sample_conv *sc;
|
struct sample_conv *sc;
|
||||||
char *p;
|
char *p;
|
||||||
#ifdef USE_OPENSSL
|
#ifdef USE_OPENSSL
|
||||||
char *args[4];
|
|
||||||
struct srv_kw *kw;
|
struct srv_kw *kw;
|
||||||
int tmp_error;
|
int tmp_error;
|
||||||
char *error;
|
char *error;
|
||||||
|
char *args[] = { /* SSL client configuration. */
|
||||||
|
"ssl",
|
||||||
|
"verify",
|
||||||
|
"none",
|
||||||
|
"force-sslv3",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialise com signals pool session. */
|
/* Initialise com signals pool session. */
|
||||||
@ -4940,14 +4946,10 @@ void hlua_init(void)
|
|||||||
socket_ssl.agent.health = socket_ssl.agent.rise; /* socket, but will fall down at first failure */
|
socket_ssl.agent.health = socket_ssl.agent.rise; /* socket, but will fall down at first failure */
|
||||||
socket_ssl.agent.server = &socket_ssl;
|
socket_ssl.agent.server = &socket_ssl;
|
||||||
|
|
||||||
socket_ssl.xprt = &raw_sock;
|
socket_ssl.use_ssl = 1;
|
||||||
|
socket_ssl.xprt = &ssl_sock;
|
||||||
|
|
||||||
args[0] = "ssl";
|
for (idx = 0; args[idx] != NULL; idx++) {
|
||||||
args[1] = "verify";
|
|
||||||
args[2] = "none";
|
|
||||||
args[3] = NULL;
|
|
||||||
|
|
||||||
for (idx = 0; idx < 3; idx++) {
|
|
||||||
if ((kw = srv_find_kw(args[idx])) != NULL) { /* Maybe it's registered server keyword */
|
if ((kw = srv_find_kw(args[idx])) != NULL) { /* Maybe it's registered server keyword */
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@ -4967,9 +4969,6 @@ void hlua_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize SSL server. */
|
/* Initialize SSL server. */
|
||||||
if (socket_ssl.xprt == &ssl_sock) {
|
ssl_sock_prepare_srv_ctx(&socket_ssl, &socket_proxy);
|
||||||
socket_ssl.use_ssl = 1;
|
|
||||||
ssl_sock_prepare_srv_ctx(&socket_ssl, &socket_proxy);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user