File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -72,13 +72,20 @@ public static function createFromEnv()
7272 $ cafile = getenv ('DOCKER_CERT_PATH ' ).DIRECTORY_SEPARATOR .'ca.pem ' ;
7373 $ certfile = getenv ('DOCKER_CERT_PATH ' ).DIRECTORY_SEPARATOR .'cert.pem ' ;
7474 $ keyfile = getenv ('DOCKER_CERT_PATH ' ).DIRECTORY_SEPARATOR .'key.pem ' ;
75- $ peername = getenv ('DOCKER_PEER_NAME ' ) ? getenv ('DOCKER_PEER_NAME ' ) : 'boot2docker ' ;
7675
77- $ options ['ssl ' ] = [
78- 'cafile ' => $ cafile ,
79- 'local_cert ' => $ certfile ,
80- 'local_pk ' => $ keyfile ,
81- 'peer_name ' => $ peername ,
76+ $ stream_context = [
77+ 'cafile ' => $ cafile ,
78+ 'local_cert ' => $ certfile ,
79+ 'local_pk ' => $ keyfile ,
80+ ];
81+
82+ if (getenv ('DOCKER_PEER_NAME ' )) {
83+ $ stream_context ['peer_name ' ] = getenv ('DOCKER_PEER_NAME ' );
84+ }
85+
86+ $ options ['ssl ' ] = true ;
87+ $ options ['stream_context_options ' ] = [
88+ 'ssl ' => $ stream_context
8289 ];
8390 }
8491
You can’t perform that action at this time.
0 commit comments