how to generate the root CA.pem in mongodb for configuring the ssl certificates?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















I am trying to configure the SSL certificates in the MongoDB community edition.



The configuration of my mongod.conf



net:
port: 27017
bindIp: 0.0.0.0 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6
addresses or, alternatively, use the net.bindIpAll setting.
ssl:
mode: requireSSL
PEMKeyFile: /etc/ssl/mongodb.pem
CAFile: /etc/ssl/ca_bundle.crt
allowConnectionsWithoutCertificates: false
allowInvalidHostnames: false
disabledProtocols: TLS1_0,TLS1_1


Here what I am doing is converting certificate.crt and private.key as mongodb.pem and passing the ca_bundle.crt as CAFile in mongod.conf



I am trying to connect with the server using the command



mongo --ssl --sslPEMKeyFile /etc/ssl/mongodb.pem --sslCAFile /etc/ssl/ca_bundle.crt --host myapptest.tk


Getting the error like




MongoDB shell version v4.0.8



connecting to: mongodb://myapptest.tk:27017/?gssapiServiceName=mongodb



2019-04-04T19:57:40.401+0000 E NETWORK [js] SSL peer certificate validation failed: unable to get local issuer certificate



2019-04-04T19:57:40.402+0000 E QUERY [js] Error: couldn't connect to server myapptest.tk:27017, connection attempt failed: SSLHandshakeFailed: SSL peer certificate validation failed: unable to get local issuer certificate :



connect@src/mongo/shell/mongo.js:343:13



@(connect):2:6



exception: connect failed




I want to know, how to create the root_CA.pem file and pass it as --sslCAFile?



where can found the ca.pem file in MongoDB?



Could anybody suggest me how to configure the SSL certificates in MongoDB?










share|improve this question









New contributor




GayathriB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    1















    I am trying to configure the SSL certificates in the MongoDB community edition.



    The configuration of my mongod.conf



    net:
    port: 27017
    bindIp: 0.0.0.0 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6
    addresses or, alternatively, use the net.bindIpAll setting.
    ssl:
    mode: requireSSL
    PEMKeyFile: /etc/ssl/mongodb.pem
    CAFile: /etc/ssl/ca_bundle.crt
    allowConnectionsWithoutCertificates: false
    allowInvalidHostnames: false
    disabledProtocols: TLS1_0,TLS1_1


    Here what I am doing is converting certificate.crt and private.key as mongodb.pem and passing the ca_bundle.crt as CAFile in mongod.conf



    I am trying to connect with the server using the command



    mongo --ssl --sslPEMKeyFile /etc/ssl/mongodb.pem --sslCAFile /etc/ssl/ca_bundle.crt --host myapptest.tk


    Getting the error like




    MongoDB shell version v4.0.8



    connecting to: mongodb://myapptest.tk:27017/?gssapiServiceName=mongodb



    2019-04-04T19:57:40.401+0000 E NETWORK [js] SSL peer certificate validation failed: unable to get local issuer certificate



    2019-04-04T19:57:40.402+0000 E QUERY [js] Error: couldn't connect to server myapptest.tk:27017, connection attempt failed: SSLHandshakeFailed: SSL peer certificate validation failed: unable to get local issuer certificate :



    connect@src/mongo/shell/mongo.js:343:13



    @(connect):2:6



    exception: connect failed




    I want to know, how to create the root_CA.pem file and pass it as --sslCAFile?



    where can found the ca.pem file in MongoDB?



    Could anybody suggest me how to configure the SSL certificates in MongoDB?










    share|improve this question









    New contributor




    GayathriB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      1












      1








      1








      I am trying to configure the SSL certificates in the MongoDB community edition.



      The configuration of my mongod.conf



      net:
      port: 27017
      bindIp: 0.0.0.0 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6
      addresses or, alternatively, use the net.bindIpAll setting.
      ssl:
      mode: requireSSL
      PEMKeyFile: /etc/ssl/mongodb.pem
      CAFile: /etc/ssl/ca_bundle.crt
      allowConnectionsWithoutCertificates: false
      allowInvalidHostnames: false
      disabledProtocols: TLS1_0,TLS1_1


      Here what I am doing is converting certificate.crt and private.key as mongodb.pem and passing the ca_bundle.crt as CAFile in mongod.conf



      I am trying to connect with the server using the command



      mongo --ssl --sslPEMKeyFile /etc/ssl/mongodb.pem --sslCAFile /etc/ssl/ca_bundle.crt --host myapptest.tk


      Getting the error like




      MongoDB shell version v4.0.8



      connecting to: mongodb://myapptest.tk:27017/?gssapiServiceName=mongodb



      2019-04-04T19:57:40.401+0000 E NETWORK [js] SSL peer certificate validation failed: unable to get local issuer certificate



      2019-04-04T19:57:40.402+0000 E QUERY [js] Error: couldn't connect to server myapptest.tk:27017, connection attempt failed: SSLHandshakeFailed: SSL peer certificate validation failed: unable to get local issuer certificate :



      connect@src/mongo/shell/mongo.js:343:13



      @(connect):2:6



      exception: connect failed




      I want to know, how to create the root_CA.pem file and pass it as --sslCAFile?



      where can found the ca.pem file in MongoDB?



      Could anybody suggest me how to configure the SSL certificates in MongoDB?










      share|improve this question









      New contributor




      GayathriB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I am trying to configure the SSL certificates in the MongoDB community edition.



      The configuration of my mongod.conf



      net:
      port: 27017
      bindIp: 0.0.0.0 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6
      addresses or, alternatively, use the net.bindIpAll setting.
      ssl:
      mode: requireSSL
      PEMKeyFile: /etc/ssl/mongodb.pem
      CAFile: /etc/ssl/ca_bundle.crt
      allowConnectionsWithoutCertificates: false
      allowInvalidHostnames: false
      disabledProtocols: TLS1_0,TLS1_1


      Here what I am doing is converting certificate.crt and private.key as mongodb.pem and passing the ca_bundle.crt as CAFile in mongod.conf



      I am trying to connect with the server using the command



      mongo --ssl --sslPEMKeyFile /etc/ssl/mongodb.pem --sslCAFile /etc/ssl/ca_bundle.crt --host myapptest.tk


      Getting the error like




      MongoDB shell version v4.0.8



      connecting to: mongodb://myapptest.tk:27017/?gssapiServiceName=mongodb



      2019-04-04T19:57:40.401+0000 E NETWORK [js] SSL peer certificate validation failed: unable to get local issuer certificate



      2019-04-04T19:57:40.402+0000 E QUERY [js] Error: couldn't connect to server myapptest.tk:27017, connection attempt failed: SSLHandshakeFailed: SSL peer certificate validation failed: unable to get local issuer certificate :



      connect@src/mongo/shell/mongo.js:343:13



      @(connect):2:6



      exception: connect failed




      I want to know, how to create the root_CA.pem file and pass it as --sslCAFile?



      where can found the ca.pem file in MongoDB?



      Could anybody suggest me how to configure the SSL certificates in MongoDB?







      mongodb ssl






      share|improve this question









      New contributor




      GayathriB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      GayathriB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 4 hours ago







      GayathriB













      New contributor




      GayathriB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 4 hours ago









      GayathriBGayathriB

      63




      63




      New contributor




      GayathriB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      GayathriB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      GayathriB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          GayathriB is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f234241%2fhow-to-generate-the-root-ca-pem-in-mongodb-for-configuring-the-ssl-certificates%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          GayathriB is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          GayathriB is a new contributor. Be nice, and check out our Code of Conduct.













          GayathriB is a new contributor. Be nice, and check out our Code of Conduct.












          GayathriB is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f234241%2fhow-to-generate-the-root-ca-pem-in-mongodb-for-configuring-the-ssl-certificates%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          ف. موراي أبراهام

          صرب

          كأس إنترتوتو