- MongoDB Administrator’s Guide
- Cyrus Dasadia
- 232字
- 2021-07-02 15:47:43
How it works...
In step 1, we created a self-signed certificate to get us started with SSL enabled connections. One could very well use a certificate signed by a valid Certificate Authority (CA), but for test purposes we are good with a self-signed certificate. In all honesty, if connection security is all you need, a self-signed certificate can also be used in a production environment as long as you keep the keys secure. You might as well take it a step forward by creating your own CA certificate and use it to sign your certificates.
In step 2, we concatenate the key and the certificate file. Next, in step 3, we start the mongod daemon with --sslMode requireSSL followed by providing the path to the concatenated .pem file. At this point, we have a standalone MongoDB server listening to the default port 27017, ready to accept only SSL based clients.
Next, we attempt to connect to the mongod server using the default non-SSL mode, which is immediately rejected by the sever. Finally, in step 5 we explicitly make an SSL connection by providing the --ssl parameter followed by --sslAllowInvalidCertificates. The latter parameter is used because we are using a self-signed certificate on the server. If we were using an certificate signed by a authorized CA or even a self-signed CA, we could very well use the --sslCAFile to provide the CA certificate.
- 程序員修煉之道:程序設計入門30講
- Developing Mobile Web ArcGIS Applications
- 軟件架構:Python語言實現
- Mastering Android Development with Kotlin
- C語言程序設計
- Mastering Python Design Patterns
- Flowable流程引擎實戰
- Learning Material Design
- Tableau Desktop可視化高級應用
- UML軟件建模
- Spring Boot從入門到實戰
- 軟硬件綜合系統軟件需求建模及可靠性綜合試驗、分析、評價技術
- 基于JavaScript的WebGIS開發
- 虛擬現實:引領未來的人機交互革命
- Mastering Responsive Web Design