Support for custom CA files
e-desouza opened this issue · comments
Elton de Souza commented
Is your feature request related to a problem? Please describe.
Support for custom CA files similar to official mongo-swift driver. e.g use-case is to connect to https://www.ibm.com/cloud/hyper-protect-dbaas
mongo-swift syntax for reference:
let sslOpts = TLSOptions(allowInvalidHostnames: true, caFile: URL(string: "cert.pem"), pemFile: nil) let mongodb = try SyncMongoClient("..connectionuri..", options: ClientOptions(serverMonitoring: false, tlsOptions: sslOpts))
Describe the solution you'd like
(from Slack https://openkitten.slack.com/archives/C5KUPE8KY/p1584685504113700)
- To add a property to the connection settings: https://github.com/OpenKitten/MongoKitten/blob/master/6.0/Sources/MongoCore/Primitives/ConnectionSettings.swift#L17
- If MongoDB’s URI spec has a query parameter for this file, respect that in the parser:
https://github.com/OpenKitten/MongoKitten/blob/master/6.0/Sources/MongoCore/Primitives/ConnectionSettings.swift#L274-L276 - Finally you’ll need to use that specification when connecting to MongoDB:
https://github.com/OpenKitten/MongoKitten/blob/master/6.0/Sources/MongoClient/Connection.swift#L121-L130
Joannis Orlandos commented
See #230