Browse Source

Fixed const qualifier issue with X509_NAME_add_entry_by_NID()

Paul-Louis Ageneau 5 years ago
parent
commit
8348b70ee6
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/certificate.cpp

+ 2 - 1
src/certificate.cpp

@@ -254,7 +254,8 @@ certificate_ptr make_certificate_impl(string commonName) {
 		throw std::runtime_error("Unable to generate key pair");
 
 	const size_t serialSize = 16;
-	const auto *commonNameBytes = reinterpret_cast<const unsigned char *>(commonName.c_str());
+	auto *commonNameBytes =
+	    reinterpret_cast<unsigned char *>(const_cast<char *>(commonName.c_str()));
 
 	if (!X509_gmtime_adj(X509_get_notBefore(x509.get()), 3600 * -1) ||
 	    !X509_gmtime_adj(X509_get_notAfter(x509.get()), 3600 * 24 * 365) ||