Change use of pn_ssl_domain_allow_unsecured_client() to pn_transport_require_encryption()
This closes
pn_ssl_domain_unsecured_client() is deprecated and may be removed.
@@ -367,12 +367,6 @@ static qd_error_t listener_setup_ssl(qd_connection_t *ctx, const qd_server_confi
pn_ssl_domain_free(domain);
return qd_error(QD_ERROR_RUNTIME, "Cannot set SSL credentials");
}
- if (!config->ssl_required) {
- if (pn_ssl_domain_allow_unsecured_client(domain)) {
- pn_ssl_domain_free(domain);
- return qd_error(QD_ERROR_RUNTIME, "Cannot allow unsecured client");
- }
- }
// for peer authentication:
if (config->ssl_trusted_certificate_db) {
@@ -414,6 +408,11 @@ static qd_error_t listener_setup_ssl(qd_connection_t *ctx, const qd_server_confi
return qd_error(QD_ERROR_RUNTIME, "Cannot initialize SSL");
}
+ // By default adding ssl to a transport forces encryption to be required, so if it's not set that here
+ if (!config->ssl_required) {
+ pn_transport_require_encryption(tport, false);
+ }
+
pn_ssl_domain_free(domain);
return QD_ERROR_NONE;
}
