Signed-off-by: Christoph Ziebuhr <chris@codefrickler.de>
{
}
+static inline void __ustream_ssl_set_server_name(struct ustream_ssl *us)
+{
+ SSL_set_tlsext_host_name(us->ssl, us->server_name);
+}
+
#endif
return buffer;
}
+static inline void __ustream_ssl_set_server_name(struct ustream_ssl *us)
+{
+ ssl_set_hostname(us->ssl, us->server_name);
+}
+
void __ustream_ssl_update_peer_cn(struct ustream_ssl *us);
void __ustream_ssl_session_free(void *ssl);
void *__ustream_ssl_session_new(struct ustream_ssl_ctx *ctx);
conn->next = &us->stream;
ustream_set_io(ctx, us->ssl, conn);
ustream_ssl_stream_init(us);
+
+ if (us->server_name)
+ __ustream_ssl_set_server_name(us);
+
ustream_ssl_check_conn(us);
return 0;
void *ssl;
char *peer_cn;
+ char *server_name;
int error;
bool connected;