Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c84c4a3

Browse files
add wechaty ca, see #16
1 parent f696d72 commit c84c4a3

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

‎README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

‎wechaty-puppet-service/IO/Github/Wechaty/PuppetService/PuppetService.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /