Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
¿Cómo conectarse a TLS usando Vue?

Quiero conectarme al servidor MQTT usando Vue. Intenté algo similar a lo que encontré en Google, pero fallé.

  • ejemplo de node.js
 var mqtt = require('mqtt'); var fs = require('fs'); var options = { host: '127.0.0.1', port: 8883, protocol: 'mqtts', protocolId: 'MQIsdp', ca: [fs.readFileSync('<path>/ca.crt')], key: fs.readFileSync('<path>/client.key'), cert: fs.readFileSync('<path>/client.crt'), passphrase: 'CLIENT KEY PASSPHRASE', secureProtocol: 'TLSv1_method', protocolVersion: 3 }; var client = mqtt.connect(options);
  • Resultados que escribí usando un método que encontré en el blog
 const option = { port: 48883, ca: [], key: '', cert: '', clientId: 'mqttjs_' + Math.random().toString(16).substr(2, 8), protocolId: 'MQTT', useSSL: true, passphrase: 'CLIENT KEY PASSPHRASE', secureProtocol: 'TLSv1_method', protocolVersion: 4, rejectUnauthorized: false, } axios.get('/' + 'ca.crt').then(response => { option.ca = [response.data] }) axios.get('/' + 'client.key').then(response => { option.key = response.data }) axios.get('/' + 'client.crt').then(response => { option.cert = response.data }) const client = mqtt.connect('wss://url', option)
  • código de error
 failed: WebSocket is closed before the connection is established. WebSocket connection to 'wss://url' failed:
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!