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

157
Views
javascript access to mssql fails due to self signed cert

I have the following js script that accesses an MSSQL server (running in a docker container at 192.168.2.5). It does a query and returns the result:

var express = require('express');
var app = express();

app.get('/', function (req, res) {
   
    var sql = require('mssql');

    // config for your database
    var config = {
        user: 'userid',
        password: 'password',
        server: 'ipaddr', 
        database: 'DBname' 
    };

    // connect to your database
    sql.connect(config, function (err) {
    
        if (err) console.log(err);

        // create Request object
        var request = new sql.Request();
           
        // query to the database and get the records
        request.query('select * from tablename', function (err, recordset) {
            
            if (err) console.log(err)

            // send records as a response
            res.send(recordset);
            
        });
    });
});

var server = app.listen(5000, function () {
    console.log('Server is running..');

The code runs fine using jsbox on ios but fails on the Mac with the following error:

ConnectionError: Failed to connect to 192.168.2.5:1433 - self signed certificate

I have 2 questions. Why does it run from ios and how to fix it on MacOS?

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!