Skip to content

Commit a5667e6

Browse files
committed
PHPC-605: Split exceptions for unsupported ca_dir and capath options
1 parent 3036797 commit a5667e6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

php_phongo.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,8 +1316,13 @@ static mongoc_ssl_opt_t *php_phongo_make_ssl_opt(zval *zoptions TSRMLS_DC)
13161316
}
13171317

13181318
#if defined(MONGOC_ENABLE_SSL_SECURE_CHANNEL) || defined(MONGOC_ENABLE_SSL_SECURE_TRANSPORT)
1319-
if (php_array_existsc(zoptions, "ca_dir") || php_array_existsc(zoptions, "capath")) {
1320-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "\"ca_dir\" and \"capath\" options are not supported by Secure Channel and Secure Transport");
1319+
if (php_array_existsc(zoptions, "ca_dir")) {
1320+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "\"ca_dir\" option is not supported by Secure Channel and Secure Transport");
1321+
return NULL;
1322+
}
1323+
1324+
if (php_array_existsc(zoptions, "capath")) {
1325+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "\"capath\" option is not supported by Secure Channel and Secure Transport");
13211326
return NULL;
13221327
}
13231328
#endif

0 commit comments

Comments
 (0)