Add basic ServerName example & impl.

This commit is contained in:
Alex Hultman
2020-08-17 02:49:36 +02:00
parent cf0a21e33b
commit d14d31ce47
4 changed files with 33 additions and 2 deletions
+7
View File
@@ -38,6 +38,13 @@ private:
public:
/* Server name */
TemplatedApp &&addServerName(std::string hostname_pattern, us_socket_context_options_t options = {}) {
us_socket_context_add_server_name(SSL, (struct us_socket_context_t *) httpContext, hostname_pattern.c_str(), options);
return std::move(*this);
}
/* Returns the SSL_CTX of this app, or nullptr. */
void *getNativeHandle() {
return us_socket_context_get_native_handle(SSL, (struct us_socket_context_t *) httpContext);