Description
Refer to #124, we have enforced the Wechaty Puppet Service to use TLS for maximum security, and satisfy the gRPC requirements.
The old versions of wechaty-puppet-service
prior to version 0.28 will not be able to work with the new versions by default.
So the actions need to be taken for our community to enable the TLS for our ecosystem should at least be include the following tasks:
- Enable TLS for Polyglot Wechaty SDK
- Wechaty (TypeScript)
- Python Wechaty @wechaty/python
- Go Wechaty @wechaty/go
- Java Wechaty @wechaty/java
- .NET Wechaty @wechaty/dotnet
- PHP Wechaty @wechaty/php
- Rust Wechaty @wechaty/rust
- Scala Wechaty @wechaty/scala
- Enable TLS for Puppet Services @wechaty/contributors
- WXWork @wechaty/juzi
- Paimon @zpaimon
- Donut
To be compatible with the old ecosystem, the new version of wechaty-puppet-services provided the following two environment variables to be used for compatible reasons. Please notice that this solution is a workaround, and we should push all of our ecosystems to move forward to work with the latest TLS/TLS versions.
Disable TLS for Puppet Service Server
To disable server TLS:
- Set
WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_SERVER
totrue
- Set
options.tls.disable
totrue
Disable TLS for Puppet Service Client
To disable client TLS:
- Set
WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_CLIENT
totrue
- Set
options.tls.disable
totrue
Compatible with non-tls server/clients
We have workarounds to make a new version of wechaty-puppet-service work with the old non-tls server/clients.
To disable tls for server / client, we can set NO_TLS_INSECURE
/options.tls.disable
:
- Should not be used for production
- It's compatible with old
wechaty-puppet-service
servers and clients which are not supported TLS. - All
wechaty-puppet-service
servers and clients should be updated to the latest version to support TLS as soon as possible. - All Polyglot Wechaty SDK should support TLS as soon as possible.
Troubleshooting
@Gcaufy: try to enable grpc trace log, you will receive more connection details
GRPC_VERBOSITY=DEBUG GRPC_TRACE=all npm run start
Problem
You will run into Error: 14 UNAVAILABLE: No connection established
if the Wechaty Puppet Service server & client does not match the TLS settings.
For examples:
- Server requires TLS but the client does not support TLS, for example, a newer server with a legacy client
- Server does not support TLS but the client is using TLS, for example, a legacy server with a newer client
Solution
Server | Client | Status | Solution (workaround) |
---|---|---|---|
TLS | no TLS | Error: 14 UNAVAILABLE |
WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_SERVER=true |
no TLS | TLS | Error: 14 UNAVAILABLE |
WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_CLIENT=true |
no TLS | no TLS | OK | N/A |
TLS | TLS | OK | N/A |