From 83defa18d958503a395e928d4669a23041014b2e Mon Sep 17 00:00:00 2001 From: Bogdan Padalko Date: Mon, 29 Feb 2016 01:02:32 +0200 Subject: [PATCH] Add SSL connection support --- amqp.c | 4 + amqp_connection.c | 182 +- amqp_connection_resource.c | 40 +- amqp_connection_resource.h | 4 + package.xml | 3 +- php_amqp.h | 4 + provision/rabbitmq.config | 8 + provision/test_certs/cacert.pem | 3893 +++++++++++++++++ provision/test_certs/cacert.pem.1 | 3893 +++++++++++++++++ provision/test_certs/client/cert.pem | 19 + provision/test_certs/client/key-cert.pem | 46 + provision/test_certs/client/key.pem | 27 + provision/test_certs/client/keycert.p12 | Bin 0 -> 2373 bytes provision/test_certs/client/req.pem | 16 + provision/test_certs/server/cert.pem | 19 + provision/test_certs/server/key.pem | 27 + provision/test_certs/server/keycert.p12 | Bin 0 -> 2373 bytes provision/test_certs/server/req.pem | 16 + provision/test_certs/testca/cacert.cer | Bin 0 -> 752 bytes provision/test_certs/testca/cacert.pem | 18 + provision/test_certs/testca/certs/01.pem | 19 + provision/test_certs/testca/certs/02.pem | 19 + provision/test_certs/testca/index.txt | 2 + provision/test_certs/testca/index.txt.attr | 1 + .../test_certs/testca/index.txt.attr.old | 1 + provision/test_certs/testca/index.txt.old | 1 + provision/test_certs/testca/openssl.cnf | 54 + provision/test_certs/testca/private/cakey.pem | 28 + provision/test_certs/testca/serial | 1 + provision/test_certs/testca/serial.old | 1 + stubs/AMQPConnection.php | 79 + tests/amqpchannel_var_dump.phpt | 20 +- .../amqpconnection_construct_with_limits.phpt | 28 +- ...mqpconnection_heartbeat_with_consumer.phpt | 26 +- tests/amqpconnection_ssl.phpt | 129 + tests/amqpconnection_var_dump.phpt | 30 +- tests/amqpexchange_setArgument.phpt | 160 +- tests/amqpexchange_set_flags.phpt | 22 +- tests/amqpexchange_var_dump.phpt | 42 +- tests/amqpqueue_setArgument.phpt | 160 +- tests/amqpqueue_var_dump.phpt | 22 +- 41 files changed, 8911 insertions(+), 153 deletions(-) create mode 100644 provision/test_certs/cacert.pem create mode 100644 provision/test_certs/cacert.pem.1 create mode 100644 provision/test_certs/client/cert.pem create mode 100644 provision/test_certs/client/key-cert.pem create mode 100644 provision/test_certs/client/key.pem create mode 100644 provision/test_certs/client/keycert.p12 create mode 100644 provision/test_certs/client/req.pem create mode 100644 provision/test_certs/server/cert.pem create mode 100644 provision/test_certs/server/key.pem create mode 100644 provision/test_certs/server/keycert.p12 create mode 100644 provision/test_certs/server/req.pem create mode 100644 provision/test_certs/testca/cacert.cer create mode 100644 provision/test_certs/testca/cacert.pem create mode 100644 provision/test_certs/testca/certs/01.pem create mode 100644 provision/test_certs/testca/certs/02.pem create mode 100644 provision/test_certs/testca/index.txt create mode 100644 provision/test_certs/testca/index.txt.attr create mode 100644 provision/test_certs/testca/index.txt.attr.old create mode 100644 provision/test_certs/testca/index.txt.old create mode 100644 provision/test_certs/testca/openssl.cnf create mode 100644 provision/test_certs/testca/private/cakey.pem create mode 100644 provision/test_certs/testca/serial create mode 100644 provision/test_certs/testca/serial.old create mode 100644 tests/amqpconnection_ssl.phpt diff --git a/amqp.c b/amqp.c index 1e3c8656..1b575b9e 100644 --- a/amqp.c +++ b/amqp.c @@ -98,6 +98,10 @@ PHP_INI_BEGIN() PHP_INI_ENTRY("amqp.channel_max", DEFAULT_CHANNEL_MAX, PHP_INI_ALL, NULL) PHP_INI_ENTRY("amqp.frame_max", DEFAULT_FRAME_MAX, PHP_INI_ALL, NULL) PHP_INI_ENTRY("amqp.heartbeat", DEFAULT_HEARTBEAT, PHP_INI_ALL, NULL) + PHP_INI_ENTRY("amqp.cacert", DEFAULT_CACERT, PHP_INI_ALL, NULL) + PHP_INI_ENTRY("amqp.cert", DEFAULT_CERT, PHP_INI_ALL, NULL) + PHP_INI_ENTRY("amqp.key", DEFAULT_KEY, PHP_INI_ALL, NULL) + PHP_INI_ENTRY("amqp.verify", DEFAULT_VERIFY, PHP_INI_ALL, NULL) PHP_INI_END() ZEND_DECLARE_MODULE_GLOBALS(amqp); diff --git a/amqp_connection.c b/amqp_connection.c index 14f73407..9060aace 100644 --- a/amqp_connection.c +++ b/amqp_connection.c @@ -61,6 +61,27 @@ zend_class_entry *amqp_connection_class_entry; zend_object_handlers amqp_connection_object_handlers; +#define PHP_AMQP_EXTRACT_CONNECTION_STR(name) \ + zdata = NULL; \ + if (ini_arr && PHP5to7_ZEND_HASH_FIND(HASH_OF(ini_arr), (name), sizeof(name), zdata)) { \ + convert_to_string(PHP5to7_MAYBE_DEREF(zdata)); \ + } \ + if (zdata && Z_STRLEN_P(PHP5to7_MAYBE_DEREF(zdata)) > 0) { \ + zend_update_property_string(this_ce, getThis(), ZEND_STRL(name), Z_STRVAL_P(PHP5to7_MAYBE_DEREF(zdata)) TSRMLS_CC); \ + } else { \ + zend_update_property_string(this_ce, getThis(), ZEND_STRL(name), INI_STR("amqp." name) TSRMLS_CC); \ + } + +#define PHP_AMQP_EXTRACT_CONNECTION_BOOL(name) \ + zdata = NULL; \ + if (ini_arr && PHP5to7_ZEND_HASH_FIND(HASH_OF(ini_arr), (name), sizeof(name), zdata)) { \ + convert_to_long(PHP5to7_MAYBE_DEREF(zdata)); \ + } \ + if (zdata) { \ + zend_update_property_bool(this_ce, getThis(), ZEND_STRL(name), Z_LVAL_P(PHP5to7_MAYBE_DEREF(zdata)) TSRMLS_CC); \ + } else { \ + zend_update_property_bool(this_ce, getThis(), ZEND_STRL(name), INI_INT("amqp." name) TSRMLS_CC); \ + } static int php_amqp_connection_resource_deleter(PHP5to7_zend_resource_le_t *el, amqp_connection_resource *connection_resource TSRMLS_DC) { @@ -74,7 +95,7 @@ static int php_amqp_connection_resource_deleter(PHP5to7_zend_resource_le_t *el, static PHP5to7_param_str_len_type_t php_amqp_get_connection_hash(amqp_connection_params *params, char **hash) { return spprintf(hash, 0, - "amqp_conn_res_h:%s_p:%d_v:%s_l:%s_p:%s_f:%d_c:%d_h:%d", + "amqp_conn_res_h:%s_p:%d_v:%s_l:%s_p:%s_f:%d_c:%d_h:%d_cacert:%s_cert:%s_key:%s", params->host, params->port, params->vhost, @@ -82,7 +103,10 @@ static PHP5to7_param_str_len_type_t php_amqp_get_connection_hash(amqp_connection params->password, params->frame_max, params->channel_max, - params->heartbeat + params->heartbeat, + params->cacert, + params->cert, + params->key ); } @@ -160,7 +184,10 @@ int php_amqp_connect(amqp_connection_object *connection, zend_bool persistent, I connection_params.read_timeout = PHP_AMQP_READ_THIS_PROP_DOUBLE("read_timeout"); connection_params.write_timeout = PHP_AMQP_READ_THIS_PROP_DOUBLE("write_timeout"); connection_params.connect_timeout = PHP_AMQP_READ_THIS_PROP_DOUBLE("connect_timeout"); - + connection_params.cacert = PHP_AMQP_READ_THIS_PROP_STRLEN("cacert") ? PHP_AMQP_READ_THIS_PROP_STR("cacert") : NULL; + connection_params.cert = PHP_AMQP_READ_THIS_PROP_STRLEN("cert") ? PHP_AMQP_READ_THIS_PROP_STR("cert") : NULL; + connection_params.key = PHP_AMQP_READ_THIS_PROP_STRLEN("key") ? PHP_AMQP_READ_THIS_PROP_STR("key") : NULL; + connection_params.verify = (int) PHP_AMQP_READ_THIS_PROP_BOOL("verify"); if (persistent) { PHP5to7_zend_resource_store_t *le = PHP5to7_ZEND_RESOURCE_EMPTY; @@ -483,6 +510,11 @@ static PHP_METHOD(amqp_connection_class, __construct) } } + PHP_AMQP_EXTRACT_CONNECTION_STR("cacert"); + PHP_AMQP_EXTRACT_CONNECTION_STR("key"); + PHP_AMQP_EXTRACT_CONNECTION_STR("cert"); + + PHP_AMQP_EXTRACT_CONNECTION_BOOL("verify"); } /* }}} */ @@ -1035,7 +1067,7 @@ static PHP_METHOD(amqp_connection_class, getUsedChannels) /* {{{ proto amqp::getMaxChannels() Get max supported channels number per connection */ -static PHP_METHOD(amqp_connection_class, getMaxChannels) +PHP_METHOD(amqp_connection_class, getMaxChannels) { PHP5to7_READ_PROP_RV_PARAM_DECL; amqp_connection_object *connection; @@ -1113,6 +1145,103 @@ static PHP_METHOD(amqp_connection_class, isPersistent) /* }}} */ +/* {{{ proto amqp::getCACert() */ +static PHP_METHOD(amqp_connection_class, getCACert) +{ + PHP5to7_READ_PROP_RV_PARAM_DECL; + PHP_AMQP_NOPARAMS(); + PHP_AMQP_RETURN_THIS_PROP("cacert"); +} +/* }}} */ + +/* {{{ proto amqp::setCACert(string cacert) */ +static PHP_METHOD(amqp_connection_class, setCACert) +{ + char *str = NULL; PHP5to7_param_str_len_type_t str_len = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { + return; + } + + zend_update_property_stringl(this_ce, getThis(), ZEND_STRL("cacert"), str, str_len TSRMLS_CC); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto amqp::getCert() */ +static PHP_METHOD(amqp_connection_class, getCert) +{ + PHP5to7_READ_PROP_RV_PARAM_DECL; + PHP_AMQP_NOPARAMS(); + PHP_AMQP_RETURN_THIS_PROP("cert"); +} +/* }}} */ + +/* {{{ proto amqp::setCert(string cert) */ +static PHP_METHOD(amqp_connection_class, setCert) +{ + char *str = NULL; PHP5to7_param_str_len_type_t str_len = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { + return; + } + + zend_update_property_stringl(this_ce, getThis(), ZEND_STRL("cert"), str, str_len TSRMLS_CC); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto amqp::getKey() */ +static PHP_METHOD(amqp_connection_class, getKey) +{ + PHP5to7_READ_PROP_RV_PARAM_DECL; + PHP_AMQP_NOPARAMS(); + PHP_AMQP_RETURN_THIS_PROP("key"); +} +/* }}} */ + +/* {{{ proto amqp::setKey(string key) */ +static PHP_METHOD(amqp_connection_class, setKey) +{ + char *str = NULL; PHP5to7_param_str_len_type_t str_len = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { + return; + } + + zend_update_property_stringl(this_ce, getThis(), ZEND_STRL("key"), str, str_len TSRMLS_CC); + + RETURN_TRUE; +} +/* }}} */ + + +/* {{{ proto amqp::getVerify() */ +static PHP_METHOD(amqp_connection_class, getVerify) +{ + PHP5to7_READ_PROP_RV_PARAM_DECL; + PHP_AMQP_NOPARAMS(); + PHP_AMQP_RETURN_THIS_PROP("verify"); +} +/* }}} */ + +/* {{{ proto amqp::setVerify(bool verify) */ +static PHP_METHOD(amqp_connection_class, setVerify) +{ + zend_bool verify = 1; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &verify) == FAILURE) { + return; + } + + zend_update_property_bool(this_ce, getThis(), ZEND_STRL("verify"), verify TSRMLS_CC); + + RETURN_TRUE; +} +/* }}} */ + /* amqp_connection_class ARG_INFO definition */ ZEND_BEGIN_ARG_INFO_EX(arginfo_amqp_connection_class__construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_ARG_ARRAY_INFO(0, credentials, 0) @@ -1210,6 +1339,34 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_amqp_connection_class_isPersistent, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_amqp_connection_class_getCACert, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_amqp_connection_class_setCACert, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) + ZEND_ARG_INFO(0, cacert) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_amqp_connection_class_getCert, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_amqp_connection_class_setCert, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) + ZEND_ARG_INFO(0, cert) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_amqp_connection_class_getKey, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_amqp_connection_class_setKey, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) + ZEND_ARG_INFO(0, key) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_amqp_connection_class_getVerify, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_amqp_connection_class_setVerify, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) + ZEND_ARG_INFO(0, verify) +ZEND_END_ARG_INFO() + zend_function_entry amqp_connection_class_functions[] = { PHP_ME(amqp_connection_class, __construct, arginfo_amqp_connection_class__construct, ZEND_ACC_PUBLIC) @@ -1251,6 +1408,18 @@ zend_function_entry amqp_connection_class_functions[] = { PHP_ME(amqp_connection_class, getHeartbeatInterval, arginfo_amqp_connection_class_getHeartbeatInterval, ZEND_ACC_PUBLIC) PHP_ME(amqp_connection_class, getMaxFrameSize, arginfo_amqp_connection_class_getMaxFrameSize, ZEND_ACC_PUBLIC) + PHP_ME(amqp_connection_class, getCACert, arginfo_amqp_connection_class_getCACert, ZEND_ACC_PUBLIC) + PHP_ME(amqp_connection_class, setCACert, arginfo_amqp_connection_class_setCACert, ZEND_ACC_PUBLIC) + + PHP_ME(amqp_connection_class, getCert, arginfo_amqp_connection_class_getCert, ZEND_ACC_PUBLIC) + PHP_ME(amqp_connection_class, setCert, arginfo_amqp_connection_class_setCert, ZEND_ACC_PUBLIC) + + PHP_ME(amqp_connection_class, getKey, arginfo_amqp_connection_class_getKey, ZEND_ACC_PUBLIC) + PHP_ME(amqp_connection_class, setKey, arginfo_amqp_connection_class_setKey, ZEND_ACC_PUBLIC) + + PHP_ME(amqp_connection_class, getVerify, arginfo_amqp_connection_class_getVerify, ZEND_ACC_PUBLIC) + PHP_ME(amqp_connection_class, setVerify, arginfo_amqp_connection_class_setVerify, ZEND_ACC_PUBLIC) + {NULL, NULL, NULL} }; @@ -1277,6 +1446,11 @@ PHP_MINIT_FUNCTION(amqp_connection) zend_declare_property_null(this_ce, ZEND_STRL("frame_max"), ZEND_ACC_PRIVATE TSRMLS_CC); zend_declare_property_null(this_ce, ZEND_STRL("heartbeat"), ZEND_ACC_PRIVATE TSRMLS_CC); + zend_declare_property_null(this_ce, ZEND_STRL("cacert"), ZEND_ACC_PRIVATE TSRMLS_CC); + zend_declare_property_null(this_ce, ZEND_STRL("key"), ZEND_ACC_PRIVATE TSRMLS_CC); + zend_declare_property_null(this_ce, ZEND_STRL("cert"), ZEND_ACC_PRIVATE TSRMLS_CC); + zend_declare_property_null(this_ce, ZEND_STRL("verify"), ZEND_ACC_PRIVATE TSRMLS_CC); + #if PHP_MAJOR_VERSION >=7 memcpy(&amqp_connection_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); diff --git a/amqp_connection_resource.c b/amqp_connection_resource.c index 1610e3d7..621bf049 100644 --- a/amqp_connection_resource.c +++ b/amqp_connection_resource.c @@ -42,6 +42,7 @@ #include #include #include +#include #ifdef PHP_WIN32 # include "win32/unistd.h" @@ -375,7 +376,44 @@ amqp_connection_resource *connection_resource_constructor(amqp_connection_params resource->connection_state = amqp_new_connection(); /* Create socket object */ - resource->socket = amqp_tcp_socket_new(resource->connection_state); + if (params->cacert) { + resource->socket = amqp_ssl_socket_new(resource->connection_state); + + if (!resource->socket) { + zend_throw_exception(amqp_connection_exception_class_entry, "Socket error: could not create SSL socket.", 0 TSRMLS_CC); + + return NULL; + } + } else { + resource->socket = amqp_tcp_socket_new(resource->connection_state); + + if (!resource->socket) { + zend_throw_exception(amqp_connection_exception_class_entry, "Socket error: could not create socket.", 0 TSRMLS_CC); + + return NULL; + } + } + + if (params->cacert && amqp_ssl_socket_set_cacert(resource->socket, params->cacert)) { + zend_throw_exception(amqp_connection_exception_class_entry, "Socket error: could not set CA certificate.", 0 TSRMLS_CC); + + return NULL; + } + + if (params->cacert) { +#if AMQP_VERSION_MAJOR * 100 + AMQP_VERSION_MINOR * 10 + AMQP_VERSION_PATCH >= 80 + amqp_ssl_socket_set_verify_peer(resource->socket, params->verify); + amqp_ssl_socket_set_verify_hostname(resource->socket, params->verify); +#else + amqp_ssl_socket_set_verify(resource->socket, params->verify); +#endif + } + + if (params->cert && params->key && amqp_ssl_socket_set_key(resource->socket, params->cert, params->key)) { + zend_throw_exception(amqp_connection_exception_class_entry, "Socket error: could not setting client cert.", 0 TSRMLS_CC); + + return NULL; + } if (params->connect_timeout > 0) { tv.tv_sec = (long int) params->connect_timeout; diff --git a/amqp_connection_resource.h b/amqp_connection_resource.h index 011b13d2..ef6323d7 100644 --- a/amqp_connection_resource.h +++ b/amqp_connection_resource.h @@ -49,6 +49,10 @@ typedef struct _amqp_connection_params { double read_timeout; double write_timeout; double connect_timeout; + char *cacert; + char *cert; + char *key; + int verify; } amqp_connection_params; /* Figure out what's going on connection and handle protocol exceptions, if any */ diff --git a/package.xml b/package.xml index 737a9eed..6b21f626 100644 --- a/package.xml +++ b/package.xml @@ -35,12 +35,13 @@ http://pear.php.net/dtd/package-2.0.xsd"> 1.2.0 - stable + beta stable PHP License #Z@46+SV@mW3^I~gRVC~J{wgk&g;7R(gM5|eL?vCB+k?2IA8N0ul} zb|FjI%93OmF&eV(>#K9#d*6G1+;h*l_niCR?;^>(MnC`vN#^B&@Tx?ZM{EcHcmNDC zbQ4U5t|H0MMI;%N|4#*BkU=TGA{r3D^~)&#GytR|gzw)AhX4?yAQ(D}NSRI@SRVOH3%@O!ry?`c;aX2(vyO!`oVJW(U5OOpn#}6#g(7K$N|v z`IF+yr0k{d_cAX%SoXR?JFTMzHtrT8%sbR;?_yJf9`C)w5(UEM-Mvr99Y_~x?8l-W z7Hl49)oSao#FNG6^Jb^+kfz%m6f<_5^6AobLkHq&hZeUlAOkkH;1eXDz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*2A_>~IEN)dk8~>xlw*qi@L;(XgZeJrK1da) zXdDIl`c^lj((&NpF(JTh^<;5HIxLrK?_&ITw<$ z)`rcKUF#YPfD*PHZr~Vjug~2YO>ZZ2#}0zdH9IE0@>E&=wJf>F8ZF+Waw$lg!DV=| z2Gn$>P1cNuANywxNzBZ_k3Tjsmk@f4J!@))isEyY2}{a zbH%OZGo|%ia8rX8_YVaDK3Wm`_K8E|0{#i=)!g?+uwfMwB3!*I?1Rd?kB&IRv7XJ{ z=d8YcXmgP{H|};GFwrcsR`_@twy@T{m&*3~2Li99L*k%|uOSxyjzWWI^=h&_asdHGsbH=s*-y*Ii~Ndo`X zWK`eS&pH1_g|k!l>1V@2M%$o%ZZQNzcDe*~XSzwyrTtBm|@_jR@oA@%Cuqnq0k_-29J#fG3L#-K8N zPQxl<0qYl)cXbWrx{|)K)IWmZufJmm>J{ul{me$C$8nf(nVVN|-_E$T7qUvKzg1v9 zt>j1*=UTJ=vX*AqpmQP!(0W@xsLzy8mSr?zD($VUlPCP*4OuPSkp?+^kz_L;iZ_fF zgZ`6fKA|a(Joevr83z@ZqDCK1Q@0a`+*fx1O literal 0 HcmV?d00001 diff --git a/provision/test_certs/client/req.pem b/provision/test_certs/client/req.pem new file mode 100644 index 00000000..b0d575eb --- /dev/null +++ b/provision/test_certs/client/req.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIChjCCAW4CAQAwQTEfMB0GA1UEAwwWdmFncmFudC11YnVudHUtd2lseS02NDEP +MA0GA1UECgwGY2xpZW50MQ0wCwYDVQQHDAQxMTcwMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA5YnRc08644YAVAuSS2Q33bipfaAiEyowL6kyoH+g6d3r +hWsso596MH4nymmFEnloVhVuYCr+66t8RTzB7d7ZU1vkuUgSUpoYyGmqW1Oc0RXs +6fu0uBQpbKhYqAVpUyaHx9K2aLogOmrfToPqumb1AYUyAbVar8UYe2O9pHKsTuia +mwN/5NtXP82CFFtWWdHp4Di6dTUBkB0iuVS5ZqQFvAMv2VPbNRPAIzbCCDfKA96e +gEz9sOuCkSOjxn/0yn+I5Ypqqz6SLahVq14KXe1zIguO0iqk2WRcDU9w+pA/KQc1 +myjcwYpEha3Kcgjt/5yn+QjRxa7xsFLiYQz4/FlFJwIDAQABoAAwDQYJKoZIhvcN +AQELBQADggEBANsQP9w37oyVSfxP+sJaVWXGnE9OXNyM90TfBEQs1fV+IAInDsIf +wJpgBjihsmLPk6bBoHJLcuoaCiyDdG0SmFpp/tCi8NenRmDiDgqG47ADhNn3ImOk +5FkMOz8t06WL8pIMGUnKOiVrsSd4o45s4Sf5q6lNDuQcFOjmNTJdKJpHYGopbr6Z +q1Ghesz6XvQM2oz22qnr9Hm2zAqi9WiIXHZzxekgZzQRduGBWKHJObgeSijQ/C/Z +XyUT/HtqEK46lOmqJ1my5rDknNyhJfkpBOseuy/ccBvWLukExz7YSQYcWIhwAcHj +UPyeH+QFq7P2/e4oqW8dOW3m2Z1dqjWg6/8= +-----END CERTIFICATE REQUEST----- diff --git a/provision/test_certs/server/cert.pem b/provision/test_certs/server/cert.pem new file mode 100644 index 00000000..c1119cff --- /dev/null +++ b/provision/test_certs/server/cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDAjCCAeqgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAmMRUwEwYDVQQDDAxNeVRl +c3RSb290Q0ExDTALBgNVBAcMBDExNjMwHhcNMTYwMjI4MjA1MzIwWhcNMjYwMjI1 +MjA1MzIwWjAyMR8wHQYDVQQDDBZ2YWdyYW50LXVidW50dS13aWx5LTY0MQ8wDQYD +VQQKDAZzZXJ2ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHYBJW +rGEiIeTEiCNm9IES2jDulPHrGRnVntgYioLapzjE2GHq2nS6CM523775wSt7ywGV +FuIFrX6gE/pbisU35VCze/R4icUWn4ogrzTSv955FnGCqOR+/4s2zDUG/sllOIG6 +L+ooQAStkR7Q1073DYCsC/ZtjoViLY1LbF8Om8ValuCgiJ4oF6EgbIKptc2lAgZc +PMqm9TNdsD6/QGiztVBtwagqkxRt9Z90M0e9LTirhj6n4VbYHPrNRl73cuWKbKu4 +UrHpntO/+QJ7d5cBDY4pzZsLxGUnskLBNv8ndlD0s+jgtpKo/5l9g3Xtnh9i+eGq +gMWejzbdMvNzrHUdAgMBAAGjLzAtMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgUgMBMG +A1UdJQQMMAoGCCsGAQUFBwMBMA0GCSqGSIb3DQEBCwUAA4IBAQAHdy8M5vV1yMd4 +ZwzpCoMZ9BXYm8HNJ2lohB9AAeqekRNJjN6Z77L2hBl4S9ELcmSF9RU1yBNvhJro +ymubh2J77w/GLjcCH/GyBOncd9/TJ5Ti3NNNTazCHBlCqSo1wHm1x9pgxe7Z77V7 +cLZFjlWzdyIQdRsUu/PO8xfJtRhetkzDBQTbZ3nVycHNOYCD2YDXGAKhZhWQgvYF +JuVMjE8nN3xYKEtDL8GCGvh72G5ixvEicDC6FlUNhVdPzGDetmpCkHLt2wrfYmWy +WoWh/WU4o5FlRb1gblgquAku3qGgj1aQZgqGBhbajSQNEd75NULgMWAQutLo3zOW +paNjxrzN +-----END CERTIFICATE----- diff --git a/provision/test_certs/server/key.pem b/provision/test_certs/server/key.pem new file mode 100644 index 00000000..376b3a88 --- /dev/null +++ b/provision/test_certs/server/key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEAx2ASVqxhIiHkxIgjZvSBEtow7pTx6xkZ1Z7YGIqC2qc4xNhh +6tp0ugjOdt+++cEre8sBlRbiBa1+oBP6W4rFN+VQs3v0eInFFp+KIK800r/eeRZx +gqjkfv+LNsw1Bv7JZTiBui/qKEAErZEe0NdO9w2ArAv2bY6FYi2NS2xfDpvFWpbg +oIieKBehIGyCqbXNpQIGXDzKpvUzXbA+v0Bos7VQbc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+pXrl+tICcn/76X7PjtiJGMLvsG26HlVjvUMIKQigyx8lnVQJernERAVsUOHQAMvJ +G+dmaC7nB6t3S2sHDvXd9PMB0x0/+yplCQ2wIzqRnlShvkv/TRnb/K8UMxBbJQdX +b72nAoGAVpTav3TdSq2cIUfiQERgphloT5byzt8k7sIXv76aW820MUU0Su2V96Lz +9/cnVOyLcT4iBaaiZtNQTtJOuIdLDr4ylBJeAT10kbThg/xUf7FdUTYEdfvnjbsM +gx/Viwz1HqPv9hq4NSJqBjVE/7gBWqLsk5SkMt7vAH57i8RpjsM= +-----END RSA PRIVATE KEY----- diff --git a/provision/test_certs/server/keycert.p12 b/provision/test_certs/server/keycert.p12 new file mode 100644 index 0000000000000000000000000000000000000000..2835c253eea2e0738eb284d8c0048977038cd6ee GIT binary patch literal 2373 zcmY+EcQhM}0>zU^h%I8(UR5E8=1Kzall7>Z~t#!~54As`SG z5Kf|VoN(rwxNt%Is+nTd0rzKe2-?HIZrsY#+Jw+gWaYM__5P=R}EZA`{1+)pqOe38U`HXY&x3qTNBpL#PS zz#HGFUaY?su$Z$W2yr}*zz(+9G)D;RJ29X*-yR*OTM@^`ER=|;_d-LP1z;X}G}9(# z<>e>lz$Dq75b>rZ{n!+{QqHH+W75*POB(8)+!Rjd`X_JgcN{u2zWlIg1IzmjAQMJF z!yU{{HsE@s$Ggz_=))OMCF`bSYfeLO>QzZdKX%Yp;G!+BBh%O`TFCyBJ!8m~OtMkI~Z|pR< zfj%p23W(wQpE`b->+eypeqlr**AMmq=O2aE)Z)8(yroQB=!V3y@SA3b z0$nv;_wwvj4kX*k)3&{6``b10Vx@wnUsG607EV_U&M#3}Q3(7@yGzpTAZ3`wr*GY44g(w#nIdhG-S!*62te-^1+p zzZz4|Iuc|cH#V{^RHUsqBuG6Ecd>KzYsh9bT(n;*dT#V7v$MPb37OsDLALGy1QCnZ z_2hW2s#ytr0`U?PKUL9u7SbNAKm5|khNZYaOUW{Z%bDW2_kW3bFkdi1O6MivQcW|Ov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Vkn@Rg|)YKMI}6@hh0=pDSE@V#Pv^uO`*nC@td1U-P7Jl zis8xb*VG=@w><(?u$#TS&H1JM-E8SP{0hEsrhf^O4-d14A8_2P?jv~9#G~X(&jl5M zVBzsnLG7a~UM1B?=SeqLg5PBI#1~W zAO53LZA|B4>Ew2m_UhHeQG=Mh&0qs3X=S$s71@>9k!`(8t7#FZG*y3MfZE8Dc6^OB z8zwgM%t;7T7f+qqK0_G<;6MEFxxg33)mI~2_2qlCVf{`8~%SH#{ phXBA_S(Pa)wgMj{RdlOcaGp1(oST*_z))ccXNY9ZI`a2R{tNsuSoZ(` literal 0 HcmV?d00001 diff --git a/provision/test_certs/server/req.pem b/provision/test_certs/server/req.pem new file mode 100644 index 00000000..d05e75ff --- /dev/null +++ b/provision/test_certs/server/req.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIChjCCAW4CAQAwQTEfMB0GA1UEAwwWdmFncmFudC11YnVudHUtd2lseS02NDEP +MA0GA1UECgwGc2VydmVyMQ0wCwYDVQQHDAQxMTc4MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAx2ASVqxhIiHkxIgjZvSBEtow7pTx6xkZ1Z7YGIqC2qc4 +xNhh6tp0ugjOdt+++cEre8sBlRbiBa1+oBP6W4rFN+VQs3v0eInFFp+KIK800r/e +eRZxgqjkfv+LNsw1Bv7JZTiBui/qKEAErZEe0NdO9w2ArAv2bY6FYi2NS2xfDpvF +WpbgoIieKBehIGyCqbXNpQIGXDzKpvUzXbA+v0Bos7VQbcGoKpMUbfWfdDNHvS04 +q4Y+p+FW2Bz6zUZe93LlimyruFKx6Z7Tv/kCe3eXAQ2OKc2bC8RlJ7JCwTb/J3ZQ +9LPo4LaSqP+ZfYN17Z4fYvnhqoDFno823TLzc6x1HQIDAQABoAAwDQYJKoZIhvcN +AQELBQADggEBAKSaRFLvpG0nq/h8j0XDNrLVYYBD5YVzbAotrXmMWXrTZOy8yfL+ +ESIS4pSPf0CqPwLY44IQuyO5uXCO45HsFPFhn7DjItTJDemEvQRM7PBWo7smN+OG +bV/KdwE18Qmm7O1VbIvOP2hQcG9c1qsUYbFkCPmrCtx9YgxO3SjuXduOncNCr+J/ +yA9qwyijXPjFNQmfqQ7EQKUQQj3T6r2wbt0OJnUtv0eOMKzAZ98avjNC0OTTU54u +W/Dhq4j+ofWSV2DhYCVH+Afrlg/SMhcW82fCDb5U3kA2F8tU4dPvWH6gIILdwPR7 +Bx7mlTnAjkPEQsaZYCSVAxfjs+iJXfeYbjA= +-----END CERTIFICATE REQUEST----- diff --git a/provision/test_certs/testca/cacert.cer b/provision/test_certs/testca/cacert.cer new file mode 100644 index 0000000000000000000000000000000000000000..9136ac4dbc92dc51a48cc5045f40f125858e1c9b GIT binary patch literal 752 zcmXqLVtQlH#CT-^GZP~d6DPwHrqWq2j_z1*z{|#|)#lOmotKf3o0Y*p%}~@pn2kA< zg_(!Pw=yKPxFje)zr@+mkk^14B+SmkVrXb)Y#=AjYiMR*WMpAvU}|h=870nZ1mc=P zxkQ`O#HfVq1V&Z{<|amd2B1^9n3@OweZt=YHbrg7%KE z7=DXc>^s(+&8a?ezFVTvz2V2T=mh=7^mXZbdZ#_FkK+yZd~|&lyX)7DZ|A>YsEOfK z@OgjZK#<0Ug9|pK2R;)ksl6n^yMvPvZ=oEz|S$PjcJ+aF6{_yUb*vs{5u^ qPwPqlKRfbHd03O|Uij(M)yX?IAN891>-gdM3+FYznv<;A{~7=bR5f(~ literal 0 HcmV?d00001 diff --git a/provision/test_certs/testca/cacert.pem b/provision/test_certs/testca/cacert.pem new file mode 100644 index 00000000..954dcd25 --- /dev/null +++ b/provision/test_certs/testca/cacert.pem @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE----- +MIIC7DCCAdSgAwIBAgIJAOQCdZroxbivMA0GCSqGSIb3DQEBCwUAMCYxFTATBgNV +BAMMDE15VGVzdFJvb3RDQTENMAsGA1UEBwwEMTE2MzAeFw0xNjAyMjgyMDUzMTla +Fw0yNjAyMjUyMDUzMTlaMCYxFTATBgNVBAMMDE15VGVzdFJvb3RDQTENMAsGA1UE +BwwEMTE2MzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALvlhSVZwUvU +4BimF8r/fDBpGDWR6w2XemHJHTXXQ/ENHydGDXbcD+BxqVPDc7K2qQ5LXqcMz1sD +DM+erCqDG63mMYqvYL2TDwIOqpzRDSCTY9RFP35y6ezLQaF97xjAORLjdMJCwg3s +DD310qv9BEVyEMa/DN9h63CHiFZcDziaB7iszWx7xM+LGIFHgPjWW2AvgWeuZ7yN +lud/Xg1XSeLXmgdF9bHtn+gAfFwNIEzv2MBSKLDBoLBnUeYWdH3SG6crdwBzrQiQ +uwTEs+VxzO0jsUP6/piy3ElsZWgnt187yPcBLj89cXDTerULV7BNPXpaYtEbQFbR +2oc4avUNKMsCAwEAAaMdMBswDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwDQYJ +KoZIhvcNAQELBQADggEBAHkkq3mZYnNkFvC2KpmCgdwCtsqhKvcBfaK+boK2Qnv4 +hLSmJIBUIyq022O6buKLeT3jpy0PoNZSs9bMb+jiFpu16HLKd5n1XOjTTBaxuLMp +WaJGnBET/w7sSm5f5wiSZYF/40AzTT9q20YYKMS+t8trttgsoMLjvxbpzUarog2c +BESn+ym4qLa2nRtk186ttaOwCxVbj/YIvfkL8mDxk5QiwQHe1cmpd2efPcGUxV7a +7zZZpfhFOrfhsh3dm+UaVHn4eLnAxfyBmCy0l28vyQs++Edd+H2mNKElR7KFSTuS +//NBDZThfGNHcfLK1ZO5s8VKnfrHw5+hnoPqnGMpj+s= +-----END CERTIFICATE----- diff --git a/provision/test_certs/testca/certs/01.pem b/provision/test_certs/testca/certs/01.pem new file mode 100644 index 00000000..c9c6c940 --- /dev/null +++ b/provision/test_certs/testca/certs/01.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDAjCCAeqgAwIBAgIBATANBgk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provision/test_certs/testca/certs/02.pem new file mode 100644 index 00000000..c1119cff --- /dev/null +++ b/provision/test_certs/testca/certs/02.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDAjCCAeqgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAmMRUwEwYDVQQDDAxNeVRl +c3RSb290Q0ExDTALBgNVBAcMBDExNjMwHhcNMTYwMjI4MjA1MzIwWhcNMjYwMjI1 +MjA1MzIwWjAyMR8wHQYDVQQDDBZ2YWdyYW50LXVidW50dS13aWx5LTY0MQ8wDQYD +VQQKDAZzZXJ2ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHYBJW +rGEiIeTEiCNm9IES2jDulPHrGRnVntgYioLapzjE2GHq2nS6CM523775wSt7ywGV +FuIFrX6gE/pbisU35VCze/R4icUWn4ogrzTSv955FnGCqOR+/4s2zDUG/sllOIG6 +L+ooQAStkR7Q1073DYCsC/ZtjoViLY1LbF8Om8ValuCgiJ4oF6EgbIKptc2lAgZc +PMqm9TNdsD6/QGiztVBtwagqkxRt9Z90M0e9LTirhj6n4VbYHPrNRl73cuWKbKu4 +UrHpntO/+QJ7d5cBDY4pzZsLxGUnskLBNv8ndlD0s+jgtpKo/5l9g3Xtnh9i+eGq +gMWejzbdMvNzrHUdAgMBAAGjLzAtMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgUgMBMG +A1UdJQQMMAoGCCsGAQUFBwMBMA0GCSqGSIb3DQEBCwUAA4IBAQAHdy8M5vV1yMd4 +ZwzpCoMZ9BXYm8HNJ2lohB9AAeqekRNJjN6Z77L2hBl4S9ELcmSF9RU1yBNvhJro +ymubh2J77w/GLjcCH/GyBOncd9/TJ5Ti3NNNTazCHBlCqSo1wHm1x9pgxe7Z77V7 +cLZFjlWzdyIQdRsUu/PO8xfJtRhetkzDBQTbZ3nVycHNOYCD2YDXGAKhZhWQgvYF +JuVMjE8nN3xYKEtDL8GCGvh72G5ixvEicDC6FlUNhVdPzGDetmpCkHLt2wrfYmWy +WoWh/WU4o5FlRb1gblgquAku3qGgj1aQZgqGBhbajSQNEd75NULgMWAQutLo3zOW +paNjxrzN +-----END CERTIFICATE----- diff --git a/provision/test_certs/testca/index.txt b/provision/test_certs/testca/index.txt new file mode 100644 index 00000000..e58f00a9 --- /dev/null +++ b/provision/test_certs/testca/index.txt @@ -0,0 +1,2 @@ +V 260225205319Z 01 unknown /CN=vagrant-ubuntu-wily-64/O=client +V 260225205320Z 02 unknown /CN=vagrant-ubuntu-wily-64/O=server diff --git a/provision/test_certs/testca/index.txt.attr b/provision/test_certs/testca/index.txt.attr new file mode 100644 index 00000000..8f7e63a3 --- /dev/null +++ b/provision/test_certs/testca/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/provision/test_certs/testca/index.txt.attr.old b/provision/test_certs/testca/index.txt.attr.old new file mode 100644 index 00000000..8f7e63a3 --- /dev/null +++ b/provision/test_certs/testca/index.txt.attr.old @@ -0,0 +1 @@ +unique_subject = yes diff --git a/provision/test_certs/testca/index.txt.old b/provision/test_certs/testca/index.txt.old new file mode 100644 index 00000000..7c7cbea0 --- /dev/null +++ b/provision/test_certs/testca/index.txt.old @@ -0,0 +1 @@ +V 260225205319Z 01 unknown /CN=vagrant-ubuntu-wily-64/O=client diff --git a/provision/test_certs/testca/openssl.cnf b/provision/test_certs/testca/openssl.cnf new file mode 100644 index 00000000..774ac621 --- /dev/null +++ b/provision/test_certs/testca/openssl.cnf @@ -0,0 +1,54 @@ +[ ca ] +default_ca = test_root_ca + +[ test_root_ca ] +dir = . +certificate = $dir/cacert.pem +database = $dir/index.txt +new_certs_dir = $dir/certs +private_key = $dir/private/cakey.pem +serial = $dir/serial + +default_crl_days = 7 +default_days = 1825 +default_md = sha256 + +policy = test_root_ca_policy +x509_extensions = certificate_extensions + +[ test_root_ca_policy ] +commonName = supplied +stateOrProvinceName = optional +countryName = optional +emailAddress = optional +organizationName = optional +organizationalUnitName = optional +domainComponent = optional + +[ certificate_extensions ] +basicConstraints = CA:false + +[ req ] +default_bits = 2048 +default_keyfile = ./private/cakey.pem +default_md = sha256 +prompt = yes +distinguished_name = root_ca_distinguished_name +x509_extensions = root_ca_extensions + +[ root_ca_distinguished_name ] +commonName = hostname + +[ root_ca_extensions ] +basicConstraints = CA:true +keyUsage = keyCertSign, cRLSign + +[ client_extensions ] +basicConstraints = CA:false +keyUsage = digitalSignature +extendedKeyUsage = 1.3.6.1.5.5.7.3.2 + +[ server_extensions ] +basicConstraints = CA:false +keyUsage = keyEncipherment +extendedKeyUsage = 1.3.6.1.5.5.7.3.1 diff --git a/provision/test_certs/testca/private/cakey.pem b/provision/test_certs/testca/private/cakey.pem new file mode 100644 index 00000000..1341e249 --- /dev/null +++ b/provision/test_certs/testca/private/cakey.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC75YUlWcFL1OAY +phfK/3wwaRg1kesNl3phyR0110PxDR8nRg123A/gcalTw3OytqkOS16nDM9bAwzP +nqwqgxut5jGKr2C9kw8CDqqc0Q0gk2PURT9+cunsy0Ghfe8YwDkS43TCQsIN7Aw9 +9dKr/QRFchDGvwzfYetwh4hWXA84mge4rM1se8TPixiBR4D41ltgL4Fnrme8jZbn +f14NV0ni15oHRfWx7Z/oAHxcDSBM79jAUiiwwaCwZ1HmFnR90hunK3cAc60IkLsE +xLPlccztI7FD+v6YstxJbGVoJ7dfO8j3AS4/PXFw03q1C1ewTT16WmLRG0BW0dqH +OGr1DSjLAgMBAAECggEBALUwDeXHmHMkkviR6a2yEjKolVTLIgvYP4ZeJlHOBFFF +Yv4/Oiqc6J55XFxOxJnYNEt5eIvD+Yx883SeQM054o4dxTZEChik37sPI4zWtj7s +gj6mjCTGcTcLhX1R8CdA7Yh+WBAfyfsc3W0+SGnbMaw5412Ty7j5Ns0rlNgaK/9a +Ogu+3CVCeuesruYGT3AHTRVUT9zd9DcXvh4Um3SGlzD/vAWMD2LwlGp6USclY7Ds +o31ANqiVuc9AFj6A6OcJmnWOozC1q6vg6PH9xw4JJ4RitP3SNqLT4C4MZkQbDzmP +CodteKNX/Ekb+8Cb4ZuUvkofbXX3XYj4iWMWhFmr4FECgYEA3JKgm09r2xLqIYGy +bN/aDE0MlVZutN66zN6DM/5eoxy0LDS68E6h3q16CrdRem2EmhMDTycH6hRI6SPO +Uh3cFKDIakNKjltMJtNmm+aU8P/QQCgO2oPBAzjPANz8wCqw/plgP1xOZuwtCCsz +oJVc47VGXZ/GShZalD//aDJhoLMCgYEA2hNVTSsi4NpNf9MDqgZ+n5xXHsuOHDVA +pY/rS2NcqM0R1QYvyu0mUda66WVqmYU/CE6oWmVDLS12evHZmQccvDB5fxSEaWd7 +YhnJ8ExYl+Y8cJFzxdr7wp+msjt7lGxhtvsLMKkTzL4hW61fuIiGQIFgvp4dCtQi +aIV30z1Ls4kCgYAf+g3Yljn/p41T0DaqvAUjdWQWnlIsXIHeQ3/n4L+djAK+yeI0 +BmJHIwUnWo4wXoIzx//Z0MG/+LLdQbiehP+r6edEKH89hhTTKCCfB12eVqe9NVF5 +8lHgArNX37Gwtj+0mU2vwdUH7MNWhNTWOfEefeA2oHwhr33wMhr34x3uKwKBgBIK +s230+ae8p9jBbnYsn2E5IAQONy2iQjzwUTkleU8F2EnVfzK8uAThTQluOImG+pYH +W+pOomYkcr7tL2F3syrmn8ahveqygwS0uX5F8rZud+WgQwHFgjqx1qq8PRckeFkZ +H+3gryCrQjtBdr/fm6vOiGB82E5DCq23DRjO42pxAoGAVbLAiNs96LVvIyMx1Jr+ +iuP5nBmDIxB2iaUyqOBoWqbCMFZ39DqgvYzQdrz2/t5OORsq+ZAbiZ86b7ttKgTs +t6FydzVcxHjfEL4qDf7B48xGjz93RMJxd0jzrWR6QYqAyKARKdBVGTCWxfxhWTiQ +fbuwdy9ls7O93cAxrZ6OqVw= +-----END PRIVATE KEY----- diff --git a/provision/test_certs/testca/serial b/provision/test_certs/testca/serial new file mode 100644 index 00000000..75016ea3 --- /dev/null +++ b/provision/test_certs/testca/serial @@ -0,0 +1 @@ +03 diff --git a/provision/test_certs/testca/serial.old b/provision/test_certs/testca/serial.old new file mode 100644 index 00000000..9e22bcb8 --- /dev/null +++ b/provision/test_certs/testca/serial.old @@ -0,0 +1 @@ +02 diff --git a/stubs/AMQPConnection.php b/stubs/AMQPConnection.php index 46c75e4c..a1a894d6 100644 --- a/stubs/AMQPConnection.php +++ b/stubs/AMQPConnection.php @@ -42,6 +42,13 @@ public function connect() * 'heartbeat' => The delay, in seconds, of the connection heartbeat that the server wants. * 0 means the server does not want a heartbeat. Note, librabbitmq has limited heartbeat support, * which means heartbeats checked only during blocking calls. + * + * TLS support (see https://www.rabbitmq.com/ssl.html for details): + * 'cacert' => Path to the CA cert file in PEM format.. + * 'cert' => Path to the client certificate in PEM foramt. + * 'key' => Path to the client key in PEM format. + * 'verify' => Enable or disable peer verification. If peer verification is enabled then the common name in the + * server certificate must match the server name. Peer verification is enabled by default. * ) * * @param array $credentials Optional array of credential information for @@ -355,4 +362,76 @@ public function getHeartbeatInterval() public function isPersistent() { } + + /** + * Get path to the CA cert file in PEM format + * + * @return string + */ + public function getCACert() + { + } + + /** + * Set path to the CA cert file in PEM format + * + * @param string $cacert + */ + public function setCACert($cacert) + { + } + + /** + * Get path to the client certificate in PEM format + * + * @return string + */ + public function getCert() + { + } + + /** + * Set path to the client certificate in PEM format + * + * @param string $cert + */ + public function setCert($cert) + { + } + + /** + * Get path to the client key in PEM format + * + * @return string + */ + public function getKey() + { + } + + /** + * Set path to the client key in PEM format + * + * @param string $key + */ + public function setKey($key) + { + } + + /** + * Get whether peer verification enabled or disabled + * + * @return bool + */ + public function getVerify() + { + } + + /** + * Enable or disable peer verification + * + * @param bool $verify + */ + public function setVerify($verify) + { + } } diff --git a/tests/amqpchannel_var_dump.phpt b/tests/amqpchannel_var_dump.phpt index 589cab70..3e606a5f 100644 --- a/tests/amqpchannel_var_dump.phpt +++ b/tests/amqpchannel_var_dump.phpt @@ -20,7 +20,7 @@ var_dump($ch); --EXPECT-- object(AMQPChannel)#2 (3) { ["connection":"AMQPChannel":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -43,6 +43,14 @@ object(AMQPChannel)#2 (3) { int(131072) ["heartbeat":"AMQPConnection":private]=> int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["prefetch_count":"AMQPChannel":private]=> int(3) @@ -51,7 +59,7 @@ object(AMQPChannel)#2 (3) { } object(AMQPChannel)#2 (3) { ["connection":"AMQPChannel":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -74,6 +82,14 @@ object(AMQPChannel)#2 (3) { int(131072) ["heartbeat":"AMQPConnection":private]=> int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["prefetch_count":"AMQPChannel":private]=> int(3) diff --git a/tests/amqpconnection_construct_with_limits.phpt b/tests/amqpconnection_construct_with_limits.phpt index 7494f5fe..1abef62d 100644 --- a/tests/amqpconnection_construct_with_limits.phpt +++ b/tests/amqpconnection_construct_with_limits.phpt @@ -14,8 +14,8 @@ $cnn->connect(); var_dump($cnn); ?> ---EXPECTF-- -object(AMQPConnection)#1 (11) { +--EXPECT-- +object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -25,17 +25,25 @@ object(AMQPConnection)#1 (11) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(10) + int(10) ["frame_max":"AMQPConnection":private]=> - %s(10240) + int(10240) ["heartbeat":"AMQPConnection":private]=> - %s(5) -} \ No newline at end of file + int(5) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) +} diff --git a/tests/amqpconnection_heartbeat_with_consumer.phpt b/tests/amqpconnection_heartbeat_with_consumer.phpt index 8da13986..1521c1fd 100644 --- a/tests/amqpconnection_heartbeat_with_consumer.phpt +++ b/tests/amqpconnection_heartbeat_with_consumer.phpt @@ -60,7 +60,7 @@ echo 'Done', PHP_EOL ?> --EXPECTF-- -object(AMQPConnection)#1 (11) { +object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -70,21 +70,29 @@ object(AMQPConnection)#1 (11) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(40) + float(40) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(256) + int(256) ["frame_max":"AMQPConnection":private]=> - %s(131072) + int(131072) ["heartbeat":"AMQPConnection":private]=> - %s(2) + int(2) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } Consumed: test message 1 (should be dead lettered) Consuming took: %fsec Timing OK (%f < %f < %f) -Done \ No newline at end of file +Done diff --git a/tests/amqpconnection_ssl.phpt b/tests/amqpconnection_ssl.phpt new file mode 100644 index 00000000..862ff639 --- /dev/null +++ b/tests/amqpconnection_ssl.phpt @@ -0,0 +1,129 @@ +--TEST-- +AMQPConnection - ssl support +--SKIPIF-- + + +--FILE-- + gethostname(), //'vagrant-ubuntu-wily-64', + 'port' => 5671, + + 'verify' => false, + + 'cacert' => "/home/vagrant/php-amqp/provision/test_certs/testca/cacert.pem", + 'cert' => "/home/vagrant/php-amqp/provision/test_certs/client/cert.pem", + 'key' => "/home/vagrant/php-amqp/provision/test_certs/client/key.pem", +); + +$cnn = new AMQPConnection($credentials); + +var_dump($cnn); + +$cnn->connect(); + +echo ($cnn->isConnected() ? 'connected' : 'disconnected'), PHP_EOL; + +echo PHP_EOL; + +$cnn = new AMQPConnection(); +$cnn->setPort(5671); +$cnn->setCACert("/home/vagrant/php-amqp/provision/test_certs/testca/cacert.pem"); +$cnn->setCert("/home/vagrant/php-amqp/provision/test_certs/client/cert.pem"); +$cnn->setKey("/home/vagrant/php-amqp/provision/test_certs/client/key.pem"); +$cnn->setVerify(false); +var_dump($cnn); + +$cnn->connect(); + +echo ($cnn->isConnected() ? 'connected' : 'disconnected'), PHP_EOL; + +//sleep(100); + +?> +--EXPECT-- +object(AMQPConnection)#1 (15) { + ["login":"AMQPConnection":private]=> + string(5) "guest" + ["password":"AMQPConnection":private]=> + string(5) "guest" + ["host":"AMQPConnection":private]=> + string(9) "localhost" + ["vhost":"AMQPConnection":private]=> + string(1) "/" + ["port":"AMQPConnection":private]=> + int(5671) + ["read_timeout":"AMQPConnection":private]=> + float(0) + ["write_timeout":"AMQPConnection":private]=> + float(0) + ["connect_timeout":"AMQPConnection":private]=> + float(0) + ["channel_max":"AMQPConnection":private]=> + int(256) + ["frame_max":"AMQPConnection":private]=> + int(131072) + ["heartbeat":"AMQPConnection":private]=> + int(0) + ["cacert":"AMQPConnection":private]=> + string(61) "/home/vagrant/php-amqp/provision/test_certs/testca/cacert.pem" + ["key":"AMQPConnection":private]=> + string(58) "/home/vagrant/php-amqp/provision/test_certs/client/key.pem" + ["cert":"AMQPConnection":private]=> + string(59) "/home/vagrant/php-amqp/provision/test_certs/client/cert.pem" + ["verify":"AMQPConnection":private]=> + bool(false) +} +connected + +object(AMQPConnection)#2 (15) { + ["login":"AMQPConnection":private]=> + string(5) "guest" + ["password":"AMQPConnection":private]=> + string(5) "guest" + ["host":"AMQPConnection":private]=> + string(9) "localhost" + ["vhost":"AMQPConnection":private]=> + string(1) "/" + ["port":"AMQPConnection":private]=> + int(5671) + ["read_timeout":"AMQPConnection":private]=> + float(0) + ["write_timeout":"AMQPConnection":private]=> + float(0) + ["connect_timeout":"AMQPConnection":private]=> + float(0) + ["channel_max":"AMQPConnection":private]=> + int(256) + ["frame_max":"AMQPConnection":private]=> + int(131072) + ["heartbeat":"AMQPConnection":private]=> + int(0) + ["cacert":"AMQPConnection":private]=> + string(61) "/home/vagrant/php-amqp/provision/test_certs/testca/cacert.pem" + ["key":"AMQPConnection":private]=> + string(58) "/home/vagrant/php-amqp/provision/test_certs/client/key.pem" + ["cert":"AMQPConnection":private]=> + string(59) "/home/vagrant/php-amqp/provision/test_certs/client/cert.pem" + ["verify":"AMQPConnection":private]=> + bool(false) +} +connected diff --git a/tests/amqpconnection_var_dump.phpt b/tests/amqpconnection_var_dump.phpt index 419a55fd..f6b142c4 100644 --- a/tests/amqpconnection_var_dump.phpt +++ b/tests/amqpconnection_var_dump.phpt @@ -23,7 +23,7 @@ var_dump($cnn); ?> --EXPECT-- bool(false) -object(AMQPConnection)#1 (11) { +object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -46,10 +46,18 @@ object(AMQPConnection)#1 (11) { int(131072) ["heartbeat":"AMQPConnection":private]=> int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } bool(true) bool(true) -object(AMQPConnection)#1 (11) { +object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -72,9 +80,17 @@ object(AMQPConnection)#1 (11) { int(131072) ["heartbeat":"AMQPConnection":private]=> int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } bool(false) -object(AMQPConnection)#1 (11) { +object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -97,4 +113,12 @@ object(AMQPConnection)#1 (11) { int(131072) ["heartbeat":"AMQPConnection":private]=> int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } diff --git a/tests/amqpexchange_setArgument.phpt b/tests/amqpexchange_setArgument.phpt index 8bf83fcf..87f2ea95 100644 --- a/tests/amqpexchange_setArgument.phpt +++ b/tests/amqpexchange_setArgument.phpt @@ -44,7 +44,7 @@ var_dump($ex); --EXPECTF-- object(AMQPExchange)#3 (9) { ["connection":"AMQPExchange":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -54,24 +54,32 @@ object(AMQPExchange)#3 (9) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(256) + int(256) ["frame_max":"AMQPConnection":private]=> - %s(131072) + int(131072) ["heartbeat":"AMQPConnection":private]=> - %s(0) + int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["channel":"AMQPExchange":private]=> object(AMQPChannel)#2 (3) { ["connection":"AMQPChannel":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -81,24 +89,32 @@ object(AMQPExchange)#3 (9) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(256) + int(256) ["frame_max":"AMQPConnection":private]=> - %s(131072) + int(131072) ["heartbeat":"AMQPConnection":private]=> - %s(0) + int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["prefetch_count":"AMQPChannel":private]=> - %s(3) + int(3) ["prefetch_size":"AMQPChannel":private]=> - %s(0) + int(0) } ["name":"AMQPExchange":private]=> string(%d) "test.exchange.ae.%f" @@ -118,7 +134,7 @@ object(AMQPExchange)#3 (9) { } object(AMQPExchange)#4 (9) { ["connection":"AMQPExchange":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -128,24 +144,32 @@ object(AMQPExchange)#4 (9) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(256) + int(256) ["frame_max":"AMQPConnection":private]=> - %s(131072) + int(131072) ["heartbeat":"AMQPConnection":private]=> - %s(0) + int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["channel":"AMQPExchange":private]=> object(AMQPChannel)#2 (3) { ["connection":"AMQPChannel":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -155,24 +179,32 @@ object(AMQPExchange)#4 (9) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(256) + int(256) ["frame_max":"AMQPConnection":private]=> - %s(131072) + int(131072) ["heartbeat":"AMQPConnection":private]=> - %s(0) + int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["prefetch_count":"AMQPChannel":private]=> - %s(3) + int(3) ["prefetch_size":"AMQPChannel":private]=> - %s(0) + int(0) } ["name":"AMQPExchange":private]=> string(%d) "test.exchange.%f" @@ -197,12 +229,12 @@ object(AMQPExchange)#4 (9) { ["x-alternate-exchange-one-more-time"]=> string(%d) "test.exchange.ae.%f" ["x-numeric-argument"]=> - %s(100000) + int(100000) } } object(AMQPExchange)#4 (9) { ["connection":"AMQPExchange":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -212,24 +244,32 @@ object(AMQPExchange)#4 (9) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(256) + int(256) ["frame_max":"AMQPConnection":private]=> - %s(131072) + int(131072) ["heartbeat":"AMQPConnection":private]=> - %s(0) + int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["channel":"AMQPExchange":private]=> object(AMQPChannel)#2 (3) { ["connection":"AMQPChannel":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -239,24 +279,32 @@ object(AMQPExchange)#4 (9) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(256) + int(256) ["frame_max":"AMQPConnection":private]=> - %s(131072) + int(131072) ["heartbeat":"AMQPConnection":private]=> - %s(0) + int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["prefetch_count":"AMQPChannel":private]=> - %s(3) + int(3) ["prefetch_size":"AMQPChannel":private]=> - %s(0) + int(0) } ["name":"AMQPExchange":private]=> string(%d) "test.exchange.%f" @@ -279,6 +327,6 @@ object(AMQPExchange)#4 (9) { ["x-empty-string"]=> string(0) "" ["x-numeric-argument"]=> - %s(100000) + int(100000) } } diff --git a/tests/amqpexchange_set_flags.phpt b/tests/amqpexchange_set_flags.phpt index 8d76e87c..5610b389 100644 --- a/tests/amqpexchange_set_flags.phpt +++ b/tests/amqpexchange_set_flags.phpt @@ -22,7 +22,7 @@ var_dump($ex); --EXPECTF-- object(AMQPExchange)#3 (9) { ["connection":"AMQPExchange":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -45,11 +45,19 @@ object(AMQPExchange)#3 (9) { int(131072) ["heartbeat":"AMQPConnection":private]=> int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["channel":"AMQPExchange":private]=> object(AMQPChannel)#2 (3) { ["connection":"AMQPChannel":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -72,6 +80,14 @@ object(AMQPExchange)#3 (9) { int(131072) ["heartbeat":"AMQPConnection":private]=> int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["prefetch_count":"AMQPChannel":private]=> int(3) @@ -95,4 +111,4 @@ object(AMQPExchange)#3 (9) { ["x-ha-policy"]=> string(3) "all" } -} \ No newline at end of file +} diff --git a/tests/amqpexchange_var_dump.phpt b/tests/amqpexchange_var_dump.phpt index 98a05b22..c603ffa5 100644 --- a/tests/amqpexchange_var_dump.phpt +++ b/tests/amqpexchange_var_dump.phpt @@ -21,7 +21,7 @@ var_dump($ex); --EXPECTF-- object(AMQPExchange)#3 (9) { ["connection":"AMQPExchange":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -44,11 +44,19 @@ object(AMQPExchange)#3 (9) { int(131072) ["heartbeat":"AMQPConnection":private]=> int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["channel":"AMQPExchange":private]=> object(AMQPChannel)#2 (3) { ["connection":"AMQPChannel":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -71,6 +79,14 @@ object(AMQPExchange)#3 (9) { int(131072) ["heartbeat":"AMQPConnection":private]=> int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["prefetch_count":"AMQPChannel":private]=> int(3) @@ -95,7 +111,7 @@ object(AMQPExchange)#3 (9) { } object(AMQPExchange)#3 (9) { ["connection":"AMQPExchange":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -118,11 +134,19 @@ object(AMQPExchange)#3 (9) { int(131072) ["heartbeat":"AMQPConnection":private]=> int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["channel":"AMQPExchange":private]=> object(AMQPChannel)#2 (3) { ["connection":"AMQPChannel":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -145,6 +169,14 @@ object(AMQPExchange)#3 (9) { int(131072) ["heartbeat":"AMQPConnection":private]=> int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["prefetch_count":"AMQPChannel":private]=> int(3) @@ -168,4 +200,4 @@ object(AMQPExchange)#3 (9) { ["x-ha-policy"]=> string(3) "all" } -} \ No newline at end of file +} diff --git a/tests/amqpqueue_setArgument.phpt b/tests/amqpqueue_setArgument.phpt index 4792bdb5..57c2a148 100644 --- a/tests/amqpqueue_setArgument.phpt +++ b/tests/amqpqueue_setArgument.phpt @@ -38,7 +38,7 @@ var_dump($q_dead); --EXPECTF-- object(AMQPQueue)#3 (9) { ["connection":"AMQPQueue":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -48,24 +48,32 @@ object(AMQPQueue)#3 (9) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(256) + int(256) ["frame_max":"AMQPConnection":private]=> - %s(131072) + int(131072) ["heartbeat":"AMQPConnection":private]=> - %s(0) + int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["channel":"AMQPQueue":private]=> object(AMQPChannel)#2 (3) { ["connection":"AMQPChannel":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -75,24 +83,32 @@ object(AMQPQueue)#3 (9) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(256) + int(256) ["frame_max":"AMQPConnection":private]=> - %s(131072) + int(131072) ["heartbeat":"AMQPConnection":private]=> - %s(0) + int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["prefetch_count":"AMQPChannel":private]=> - %s(3) + int(3) ["prefetch_size":"AMQPChannel":private]=> - %s(0) + int(0) } ["name":"AMQPQueue":private]=> string(%d) "test.queue.%f" @@ -112,7 +128,7 @@ object(AMQPQueue)#3 (9) { } object(AMQPQueue)#4 (9) { ["connection":"AMQPQueue":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -122,24 +138,32 @@ object(AMQPQueue)#4 (9) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(256) + int(256) ["frame_max":"AMQPConnection":private]=> - %s(131072) + int(131072) ["heartbeat":"AMQPConnection":private]=> - %s(0) + int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["channel":"AMQPQueue":private]=> object(AMQPChannel)#2 (3) { ["connection":"AMQPChannel":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -149,24 +173,32 @@ object(AMQPQueue)#4 (9) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(256) + int(256) ["frame_max":"AMQPConnection":private]=> - %s(131072) + int(131072) ["heartbeat":"AMQPConnection":private]=> - %s(0) + int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["prefetch_count":"AMQPChannel":private]=> - %s(3) + int(3) ["prefetch_size":"AMQPChannel":private]=> - %s(0) + int(0) } ["name":"AMQPQueue":private]=> string(%d) "test.queue.dead.%f" @@ -187,12 +219,12 @@ object(AMQPQueue)#4 (9) { ["x-dead-letter-routing-key"]=> string(%d) "test.queue.%f" ["x-message-ttl"]=> - %s(100000) + int(100000) } } object(AMQPQueue)#4 (9) { ["connection":"AMQPQueue":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -202,24 +234,32 @@ object(AMQPQueue)#4 (9) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(256) + int(256) ["frame_max":"AMQPConnection":private]=> - %s(131072) + int(131072) ["heartbeat":"AMQPConnection":private]=> - %s(0) + int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["channel":"AMQPQueue":private]=> object(AMQPChannel)#2 (3) { ["connection":"AMQPChannel":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -229,24 +269,32 @@ object(AMQPQueue)#4 (9) { ["vhost":"AMQPConnection":private]=> string(1) "/" ["port":"AMQPConnection":private]=> - %s(5672) + int(5672) ["read_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["write_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["connect_timeout":"AMQPConnection":private]=> - %s(0) + float(0) ["channel_max":"AMQPConnection":private]=> - %s(256) + int(256) ["frame_max":"AMQPConnection":private]=> - %s(131072) + int(131072) ["heartbeat":"AMQPConnection":private]=> - %s(0) + int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["prefetch_count":"AMQPChannel":private]=> - %s(3) + int(3) ["prefetch_size":"AMQPChannel":private]=> - %s(0) + int(0) } ["name":"AMQPQueue":private]=> string(%d) "test.queue.dead.%f" @@ -265,6 +313,6 @@ object(AMQPQueue)#4 (9) { ["x-dead-letter-exchange"]=> string(0) "" ["x-message-ttl"]=> - %s(100000) + int(100000) } } diff --git a/tests/amqpqueue_var_dump.phpt b/tests/amqpqueue_var_dump.phpt index 20b5234f..59168508 100644 --- a/tests/amqpqueue_var_dump.phpt +++ b/tests/amqpqueue_var_dump.phpt @@ -24,7 +24,7 @@ var_dump($q); --EXPECT-- object(AMQPQueue)#4 (9) { ["connection":"AMQPQueue":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -47,11 +47,19 @@ object(AMQPQueue)#4 (9) { int(131072) ["heartbeat":"AMQPConnection":private]=> int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["channel":"AMQPQueue":private]=> object(AMQPChannel)#2 (3) { ["connection":"AMQPChannel":private]=> - object(AMQPConnection)#1 (11) { + object(AMQPConnection)#1 (15) { ["login":"AMQPConnection":private]=> string(5) "guest" ["password":"AMQPConnection":private]=> @@ -74,6 +82,14 @@ object(AMQPQueue)#4 (9) { int(131072) ["heartbeat":"AMQPConnection":private]=> int(0) + ["cacert":"AMQPConnection":private]=> + string(0) "" + ["key":"AMQPConnection":private]=> + string(0) "" + ["cert":"AMQPConnection":private]=> + string(0) "" + ["verify":"AMQPConnection":private]=> + bool(true) } ["prefetch_count":"AMQPChannel":private]=> int(3) @@ -95,4 +111,4 @@ object(AMQPQueue)#4 (9) { ["arguments":"AMQPQueue":private]=> array(0) { } -} \ No newline at end of file +}