File tree 1 file changed +13
-6
lines changed
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()
72
72
$ cafile = getenv ('DOCKER_CERT_PATH ' ).DIRECTORY_SEPARATOR .'ca.pem ' ;
73
73
$ certfile = getenv ('DOCKER_CERT_PATH ' ).DIRECTORY_SEPARATOR .'cert.pem ' ;
74
74
$ keyfile = getenv ('DOCKER_CERT_PATH ' ).DIRECTORY_SEPARATOR .'key.pem ' ;
75
- $ peername = getenv ('DOCKER_PEER_NAME ' ) ? getenv ('DOCKER_PEER_NAME ' ) : 'boot2docker ' ;
76
75
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
82
89
];
83
90
}
84
91
You can’t perform that action at this time.
0 commit comments