jai1 commented on a change in pull request #3577: Add LetsEncrypt as default 
trusted CA for C++ client
URL: https://github.com/apache/pulsar/pull/3577#discussion_r256524117
 
 

 ##########
 File path: pulsar-client-cpp/lib/DefaultCAs.cc
 ##########
 @@ -0,0 +1,88 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "DefaultCAs.h"
+
+#include <array>
+#include <iostream>
+#include <fstream>
+#include <cstdio>
+#include <boost/asio/buffer.hpp>
+
+namespace pulsar {
+
+const static std::array<std::string, 1> CAcerts = {{
+
+    // LetsEncrypt root certificate
+    // from https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem.txt
+    // Subject: CN=Let's Encrypt Authority X3, O=Let's Encrypt, C=US
+    //  Validity: [From: Thu Mar 17 09:40:46 PDT 2016,
+    //               To: Wed Mar 17 09:40:46 PDT 2021]
+    R"(
+-----BEGIN CERTIFICATE-----
 
 Review comment:
   Better to use a different pem file for this and not put this info in code.
   
   Also FWIW - I don't think we should put certificates in pulsar repo. What if 
due to some security vulnerability this CA cert is compromised and needs to be 
revoked or it expires after some time. I would prefer writing down steps/script 
on how the user can include letsencrypt cert in their trust store instead of 
adding a trusted pem file.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to