# Connect with Node.js using SSL

The following is an example of using a certificate file with `singlestore-nodejs`.

```javascript
const singlestore = require("singlestore-nodejs");
var fs = require("fs");

var connection = singlestore.createConnection({
    host: <hostname>,
    user: '<username>',
    password: <password>,
    ssl: {
        ca: fs.readFileSync(__dirname + '/singlestore_bundle.pem')
    }
});

connection.connect();
connection.end();

```

***

Modified at: May 15, 2026

Source: [/db/v9.1/developer-resources/connect-with-application-development-tools/connect-with-node-js/connect-with-node-js-using-ssl/](https://docs.singlestore.com/db/v9.1/developer-resources/connect-with-application-development-tools/connect-with-node-js/connect-with-node-js-using-ssl/)

(An index of the documentation is available at /llms.txt)
