+static void uclient_ssl_notify_error(struct ustream_ssl *ssl, int error, const char *str)
+{
+ struct uclient_http *uh = container_of(ssl, struct uclient_http, ussl);
+
+ uclient_http_error(uh, UCLIENT_ERROR_CONNECT);
+}
+
+static void uclient_ssl_notify_verify_error(struct ustream_ssl *ssl, int error, const char *str)
+{
+ struct uclient_http *uh = container_of(ssl, struct uclient_http, ussl);
+
+ if (!uh->ssl_require_validation)
+ return;
+
+ uclient_http_error(uh, UCLIENT_ERROR_SSL_INVALID_CERT);
+}
+
+static void uclient_ssl_notify_connected(struct ustream_ssl *ssl)
+{
+ struct uclient_http *uh = container_of(ssl, struct uclient_http, ussl);
+
+ if (!uh->ssl_require_validation)
+ return;
+
+ if (!uh->ussl.valid_cn)
+ uclient_http_error(uh, UCLIENT_ERROR_SSL_CN_MISMATCH);
+}
+