mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
MINOR: ssl: Release Servers SSL context when HAProxy is shut down
[wt: could be backported to 1.5 as well]
This commit is contained in:
parent
d2cab92e75
commit
77fe80c0b4
@ -46,6 +46,7 @@ int ssl_sock_handshake(struct connection *conn, unsigned int flag);
|
|||||||
int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, SSL_CTX *ctx, struct proxy *proxy);
|
int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, SSL_CTX *ctx, struct proxy *proxy);
|
||||||
int ssl_sock_prepare_all_ctx(struct bind_conf *bind_conf, struct proxy *px);
|
int ssl_sock_prepare_all_ctx(struct bind_conf *bind_conf, struct proxy *px);
|
||||||
int ssl_sock_prepare_srv_ctx(struct server *srv, struct proxy *px);
|
int ssl_sock_prepare_srv_ctx(struct server *srv, struct proxy *px);
|
||||||
|
void ssl_sock_free_srv_ctx(struct server *srv);
|
||||||
void ssl_sock_free_all_ctx(struct bind_conf *bind_conf);
|
void ssl_sock_free_all_ctx(struct bind_conf *bind_conf);
|
||||||
int ssl_sock_load_ca(struct bind_conf *bind_conf, struct proxy *px);
|
int ssl_sock_load_ca(struct bind_conf *bind_conf, struct proxy *px);
|
||||||
void ssl_sock_free_ca(struct bind_conf *bind_conf);
|
void ssl_sock_free_ca(struct bind_conf *bind_conf);
|
||||||
|
@ -1411,6 +1411,10 @@ void deinit(void)
|
|||||||
free(s->agent.bi);
|
free(s->agent.bi);
|
||||||
free(s->agent.bo);
|
free(s->agent.bo);
|
||||||
free((char*)s->conf.file);
|
free((char*)s->conf.file);
|
||||||
|
#ifdef USE_OPENSSL
|
||||||
|
if (s->use_ssl || s->check.use_ssl)
|
||||||
|
ssl_sock_free_srv_ctx(s);
|
||||||
|
#endif
|
||||||
free(s);
|
free(s);
|
||||||
s = s_next;
|
s = s_next;
|
||||||
}/* end while(s) */
|
}/* end while(s) */
|
||||||
|
@ -2444,6 +2444,14 @@ int ssl_sock_prepare_all_ctx(struct bind_conf *bind_conf, struct proxy *px)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* release ssl context allocated for servers. */
|
||||||
|
void ssl_sock_free_srv_ctx(struct server *srv)
|
||||||
|
{
|
||||||
|
if (srv->ssl_ctx.ctx)
|
||||||
|
SSL_CTX_free(srv->ssl_ctx.ctx);
|
||||||
|
}
|
||||||
|
|
||||||
/* Walks down the two trees in bind_conf and frees all the certs. The pointer may
|
/* Walks down the two trees in bind_conf and frees all the certs. The pointer may
|
||||||
* be NULL, in which case nothing is done. The default_ctx is nullified too.
|
* be NULL, in which case nothing is done. The default_ctx is nullified too.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user