You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/10/14 08:29:44 UTC

[GitHub] [pulsar] Titan557 opened a new issue #8257: Unable to connect to apache pulsar broker using websocket after tls setup

Titan557 opened a new issue #8257:
URL: https://github.com/apache/pulsar/issues/8257


   Hi I kinda new to apache pulsar.
   
   I have setup a production setup which consist of zookeeper, bookie & broker and able to use websocket client api to publish as a producer and consume as a consumer.
   
   But as soon as I implement tls, I can't connect anymore. 
   
   ```
   `var WebSocket = require('ws'),
       topic = "wss://mydomain:8443/ws/v2/producer/persistent/public/default/my-topic",
       ws = new WebSocket(topic);
   
   var message = {
     "payload" : new Buffer("Hello World roger").toString('base64'),
     "properties": {
       "key1" : "value1",
       "key2" : "value2"
     },
     "context" : "1"
   };
   
   ws.on('open', function() {
     // Send one message
     ws.send(JSON.stringify(message));
   });
   
   ws.on('message', function(message) {
     console.log('received ack: %s', message);
   });
   
   ws.on('error', function(message) {
     console.log("error here: " + message);
   });
   ```
   
   I get an  'unable to verify the first certificate' when I run this code. (This is nodejs)`
   
   How can I implement tls using the websocket api? I can't find it anywhere on the documentation. Hope anyone here can give me a direction and guide on how to implement this. 
   
   Thank you.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org