int ckch_inst_new_load_store(const char *path, struct ckch_store *ckchs, struct bind_conf *bind_conf,
struct ssl_bind_conf *ssl_conf, char **sni_filter, int fcount, int is_default, struct ckch_inst **ckchi, char **err);
int ckch_inst_new_load_srv_store(const char *path, struct ckch_store *ckchs,
- struct ckch_inst **ckchi, char **err);
+ struct ckch_inst **ckchi, char **err, int is_quic);
int ckch_inst_rebuild(struct ckch_store *ckch_store, struct ckch_inst *ckchi,
struct ckch_inst **new_inst, char **err);
fcount = ckchi->crtlist_entry->fcount;
}
- if (ckchi->is_server_instance)
- errcode |= ckch_inst_new_load_srv_store(ckch_store->path, ckch_store, new_inst, err);
+ if (ckchi->is_server_instance) {
+ errcode |= ckch_inst_new_load_srv_store(ckch_store->path, ckch_store, new_inst, err, srv_is_quic(ckchi->server));
+ }
else
errcode |= ckch_inst_new_load_store(ckch_store->path, ckch_store, ckchi->bind_conf, ckchi->ssl_conf, sni_filter, fcount, ckchi->is_default, new_inst, err);
#include <haproxy/proxy.h>
#include <haproxy/quic_conn.h>
#include <haproxy/quic_openssl_compat.h>
+#include <haproxy/quic_ssl.h>
#include <haproxy/quic_tp.h>
#include <haproxy/sample.h>
#include <haproxy/sc_strm.h>
return errcode;
}
+#ifdef USE_QUIC
+static inline SSL_CTX *ssl_sock_new_ssl_ctx(int is_quic)
+{
+ if (is_quic)
+ return ssl_quic_srv_new_ssl_ctx();
+ else
+ return SSL_CTX_new(SSLv23_client_method());
+}
+#else
+static inline SSL_CTX *ssl_sock_new_ssl_ctx(int is_quic)
+{
+ return SSL_CTX_new(SSLv23_client_method());
+}
+#endif
/*
* This function allocate a ckch_inst that will be used on the backend side
* ERR_WARN if a warning is available into err
*/
int ckch_inst_new_load_srv_store(const char *path, struct ckch_store *ckchs,
- struct ckch_inst **ckchi, char **err)
+ struct ckch_inst **ckchi, char **err, int is_quic)
{
SSL_CTX *ctx;
struct ckch_data *data;
data = ckchs->data;
- ctx = SSL_CTX_new(SSLv23_client_method());
+ ctx = ssl_sock_new_ssl_ctx(is_quic);
if (!ctx) {
memprintf(err, "%sunable to allocate SSL context for cert '%s'.\n",
err && *err ? *err : "", path);
int errcode = 0;
/* we found the ckchs in the tree, we can use it directly */
- errcode |= ckch_inst_new_load_srv_store(path, ckchs, ckch_inst, err);
+ errcode |= ckch_inst_new_load_srv_store(path, ckchs, ckch_inst, err,
+ srv_is_quic(server));
if (errcode & ERR_CODE)
return errcode;
/* The context will be uninitialized if there wasn't any "cert" option
* in the server line. */
if (!ctx) {
- ctx = SSL_CTX_new(SSLv23_client_method());
+ ctx = ssl_sock_new_ssl_ctx(srv_is_quic(srv));
if (!ctx) {
ha_alert("unable to allocate ssl context.\n");
cfgerr++;