I am trying to connect to mongodb using ssl certificate in julia. What I need is the equivalent of code below wrote in nodejs:
var MongoClient = require('mongodb').MongoClient,
f = require('util').format,
fs = require('fs');
// Read the certificate authority
var ca = [fs.readFileSync(__dirname + "/ssl/ca.pem")];
var cert = fs.readFileSync(__dirname + "/ssl/client.pem");
var key = fs.readFileSync(__dirname + "/ssl/client.pem");
// Connect validating the returned certificates from the server
MongoClient.connect("mongodb://localhost:27017/test?ssl=true", {
server: {
sslValidate:true
, sslCA:ca
, sslKey:key
, sslCert:cert
, sslPass:'10gen'
}
}, function(err, db) {
db.close();
});
What I found is mongoc.jl tutorial in which described how to connect, but there is nothing about ssl certificates.
https://felipenoris.github.io/Mongoc.jl/stable/tutorial/#Connecting-to-MongoDB-1
could anyone help me how to connect using ssl certificates?
Thank you!