File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
wechaty-puppet-service/IO/Github/Wechaty/PuppetService Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,8 @@ For Puppet Client:
8484| ` WECHATY_PUPPET_SERVICE_TLS_SERVER_NAME ` | ` options.serverName ` | Server Name (mast match for SNI) |
8585| ` WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_CLIENT ` | ` options.tls.disable ` | Set ` true ` to disable client TLS |
8686
87+ > Learn more about tls at https://github.com/wechaty/puppet-service
88+
8789## The World's Shortest PHP ChatBot: 8 lines of Code
8890
8991### php
Original file line number Diff line number Diff line change @@ -795,10 +795,19 @@ function ($metadata,
795795 // WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_CLIENT
796796 // WECHATY_PUPPET_SERVICE_TLS_CA_CERT
797797 // WECHATY_PUPPET_SERVICE_TLS_SERVER_NAME
798- $ this ->_grpcClient = new \Wechaty \PuppetClient ($ hostname , [
799- 'credentials ' => \Grpc \ChannelCredentials::createInsecure (),
800- 'update_metadata ' => $ updateMetadata ,
801- ]);
798+ $ noTls = getenv ("WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_CLIENT " );
799+ if ($ noTls ) {
800+ $ this ->_grpcClient = new \Wechaty \PuppetClient ($ hostname , [
801+ 'credentials ' => \Grpc \ChannelCredentials::createInsecure (),
802+ 'update_metadata ' => $ updateMetadata ,
803+ ]);
804+ } else {
805+ $ this ->_grpcClient = new \Wechaty \PuppetClient ($ hostname , [
806+ 'credentials ' => \Grpc \ChannelCredentials::createInsecure (),
807+ 'update_metadata ' => $ updateMetadata ,
808+ ]);
809+ }
810+
802811 return $ this ->_grpcClient ;
803812 }
804813
You can’t perform that action at this time.
0 commit comments