-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-633: Include libmongoc SSL, crypto, and SASL details in phpinfo() #498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1963,22 +1963,68 @@ PHP_GSHUTDOWN_FUNCTION(mongodb) | |
PHP_MINFO_FUNCTION(mongodb) | ||
{ | ||
php_info_print_table_start(); | ||
php_info_print_table_header(2, "mongodb support", "enabled"); | ||
php_info_print_table_row(2, "mongodb version", MONGODB_VERSION_S); | ||
php_info_print_table_row(2, "mongodb stability", MONGODB_STABILITY_S); | ||
php_info_print_table_header(2, "MongoDB support", "enabled"); | ||
php_info_print_table_row(2, "MongoDB extension version", MONGODB_VERSION_S); | ||
php_info_print_table_row(2, "MongoDB extension stability", MONGODB_STABILITY_S); | ||
|
||
#ifdef HAVE_SYSTEM_LIBBSON | ||
php_info_print_table_row(2, "libbson headers version", BSON_VERSION_S); | ||
php_info_print_table_row(2, "libbson library version", bson_get_version()); | ||
#else | ||
php_info_print_table_row(2, "libbson bundled version", BSON_VERSION_S); | ||
#endif | ||
|
||
#ifdef HAVE_SYSTEM_LIBMONGOC | ||
php_info_print_table_row(2, "libmongoc headers version", MONGOC_VERSION_S); | ||
php_info_print_table_row(2, "libmongoc library version", mongoc_get_version()); | ||
#else | ||
/* Bundled libraries, buildtime = runtime */ | ||
php_info_print_table_row(2, "libmongoc version", MONGOC_VERSION_S); | ||
php_info_print_table_row(2, "libmongoc bundled version", MONGOC_VERSION_S); | ||
#endif | ||
#ifdef HAVE_SYSTEM_LIBBSON | ||
php_info_print_table_row(2, "libbson headers version", BSON_VERSION_S); | ||
php_info_print_table_row(2, "libbson library version", bson_get_version()); | ||
|
||
#ifdef MONGOC_ENABLE_SSL | ||
php_info_print_table_row(2, "libmongoc SSL", "enabled"); | ||
# if defined(MONGOC_ENABLE_SSL_OPENSSL) | ||
php_info_print_table_row(2, "libmongoc SSL library", "OpenSSL"); | ||
# elif defined(MONGOC_ENABLE_SSL_LIBRESSL) | ||
php_info_print_table_row(2, "libmongoc SSL library", "LibreSSL"); | ||
# elif defined(MONGOC_ENABLE_SSL_SECURE_TRANSPORT) | ||
php_info_print_table_row(2, "libmongoc SSL library", "Secure Transport"); | ||
# elif defined(MONGOC_ENABLE_SSL_SECURE_CHANNEL) | ||
php_info_print_table_row(2, "libmongoc SSL library", "Secure Channel"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this looks like something that could easily break in the future. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having libmongoc return a string would be helpful, but we won't have that available in 1.5.x anyway. I suppose we should have a final |
||
# else | ||
php_info_print_table_row(2, "libmongoc SSL library", "unknown"); | ||
# endif | ||
#else | ||
php_info_print_table_row(2, "libmongoc SSL", "disabled"); | ||
#endif | ||
|
||
#ifdef MONGOC_ENABLE_CRYPTO | ||
php_info_print_table_row(2, "libmongoc crypto", "enabled"); | ||
# if defined(MONGOC_ENABLE_CRYPTO_LIBCRYPTO) | ||
php_info_print_table_row(2, "libmongoc crypto library", "libcrypto"); | ||
# elif defined(MONGOC_ENABLE_CRYPTO_COMMON_CRYPTO) | ||
php_info_print_table_row(2, "libmongoc crypto library", "Common Crypto"); | ||
# elif defined(MONGOC_ENABLE_CRYPTO_CNG) | ||
php_info_print_table_row(2, "libmongoc crypto library", "CNG"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These values can technically be inferred from the SSL library, but I didn't see the harm in including them. |
||
# else | ||
php_info_print_table_row(2, "libmongoc crypto library", "unknown"); | ||
# endif | ||
# ifdef MONGOC_ENABLE_CRYPTO_SYSTEM_PROFILE | ||
php_info_print_table_row(2, "libmongoc crypto system profile", "enabled"); | ||
# else | ||
php_info_print_table_row(2, "libmongoc crypto system profile", "disabled"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIK, this is currently only relevant to OpenSSL, which uses libcrypto. In any event, I liked including it at all times (if crypto is enabled) for consistency. @bjori: Am I correct in assuming this will never apply to LibreSSL, despite the fact that it also uses libcrypto? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this isn't related to libcrypto. This is related to which SSL/TLS ciphers we announce support for during SSL/TLS handshake. The default for libressl's libtls is the string The default for OpenSSL is "every cipher I have ever heard of", so instead of that, we explicitly set the list of ciphers to To be honest, I don't actually know if you can do such thing in libtls. It seems unlikely as it doesn't provide any additional value since the default configure is secure by default. |
||
# endif | ||
#else | ||
php_info_print_table_row(2, "libbson version", BSON_VERSION_S); | ||
php_info_print_table_row(2, "libmongoc crypto", "disabled"); | ||
#endif | ||
|
||
#ifdef MONGOC_ENABLE_SASL | ||
php_info_print_table_row(2, "libmongoc SASL", "enabled"); | ||
#else | ||
php_info_print_table_row(2, "libmongoc SASL", "disabled"); | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we care about reporting |
||
|
||
php_info_print_table_end(); | ||
|
||
DISPLAY_INI_ENTRIES(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,17 @@ phpinfo(); | |
%a | ||
mongodb | ||
|
||
mongodb support => enabled | ||
mongodb version => 1.%d.%d%S | ||
mongodb stability => %s | ||
libmongoc version => 1.%s | ||
libbson version => 1.%s | ||
MongoDB support => enabled | ||
MongoDB extension version => 1.%d.%d%S | ||
MongoDB extension stability => %s | ||
libbson bundled version => 1.%d.%d%S | ||
libmongoc bundled version => 1.%d.%d%S | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. libbson and libmongoc follow the same version format with optional trailing strings, so I updated these patterns to match our own. |
||
libmongoc SSL => enabled | ||
libmongoc SSL library => %s | ||
libmongoc crypto => enabled | ||
libmongoc crypto library => %s | ||
libmongoc crypto system profile => %s | ||
libmongoc SASL => enabled | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm making assumptions that CI will build with SSL and SASL, but make no assumptions about the SSL and cypto libraries. This should continue to work once we start supporting other libraries for Darwin and Windows. |
||
|
||
Directive => Local Value => Master Value | ||
mongodb.debug => no value => no value | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including "bundled" here was more clear than simply saying "libbson version". I also moved the libbson output above libmongoc in advance of adding the additional SSL, crypto, and SASL information.