nodece commented on code in PR #15485:
URL: https://github.com/apache/pulsar/pull/15485#discussion_r999189147


##########
site2/docs/security-tls-transport.md:
##########
@@ -324,6 +324,46 @@ var client = PulsarClient.Builder()
 
 > Note that `VerifyCertificateName` refers to the configuration of hostname 
 > verification in the C# client.
 
+</TabItem>
+<TabItem value="WebSocket API">
+
+```python
+import websockets
+import asyncio
+import base64
+import json
+import ssl
+import pathlib
+
+ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)

Review Comment:
   ```suggestion
   ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
   client_cert_pem = pathlib.Path(__file__).with_name("client.cert.pem")
   client_key_pem = pathlib.Path(__file__).with_name("client.key.pem")
   ca_cert_pem = pathlib.Path(__file__).with_name("ca.cert.pem")
   ssl_context.load_cert_chain(certfile=client_cert_pem, keyfile=client_key_pem)
   ssl_context.load_verify_locations(ca_cert_pem)
   # websocket producer uri wss, not ws
   uri = 
"wss://localhost:8080/ws/v2/producer/persistent/public/default/testtopic"
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to