- 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.
- 軟件安全技術(shù)
- 復(fù)雜軟件設(shè)計(jì)之道:領(lǐng)域驅(qū)動(dòng)設(shè)計(jì)全面解析與實(shí)戰(zhàn)
- C#編程入門(mén)指南(上下冊(cè))
- Learning RabbitMQ
- Mastering OpenCV 4
- 機(jī)械工程師Python編程:入門(mén)、實(shí)戰(zhàn)與進(jìn)階
- SSM輕量級(jí)框架應(yīng)用實(shí)戰(zhàn)
- Learning OpenStack Networking(Neutron)
- 微信小程序全棧開(kāi)發(fā)技術(shù)與實(shí)戰(zhàn)(微課版)
- Python極簡(jiǎn)講義:一本書(shū)入門(mén)數(shù)據(jù)分析與機(jī)器學(xué)習(xí)
- 移動(dòng)互聯(lián)網(wǎng)軟件開(kāi)發(fā)實(shí)驗(yàn)指導(dǎo)
- Java EE架構(gòu)設(shè)計(jì)與開(kāi)發(fā)實(shí)踐
- Python第三方庫(kù)開(kāi)發(fā)應(yīng)用實(shí)戰(zhàn)
- 安卓工程師教你玩轉(zhuǎn)Android
- JavaEE架構(gòu)與程序設(shè)計(jì)