diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp
index 6da91ff..9e958cb 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -615,7 +615,7 @@
 static void getCertificateProperties(
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
     const std::string& objectPath, const std::string& service,
-    const std::string& certId, const std::string& certURL,
+    const std::string& certId, const boost::urls::url& certURL,
     const std::string& name)
 {
     BMCWEB_LOG_DEBUG << "getCertificateProperties Path=" << objectPath
@@ -701,7 +701,8 @@
                 }
             }
         }
-        asyncResp->res.addHeader("Location", certURL);
+        asyncResp->res.addHeader(
+            "Location", std::string_view(certURL.data(), certURL.size()));
         },
         service, objectPath, certs::dbusPropIntf, "GetAll",
         certs::certPropIntf);
@@ -811,7 +812,7 @@
         std::shared_ptr<CertificateFile> certFile =
             std::make_shared<CertificateFile>(certificate);
         crow::connections::systemBus->async_method_call(
-            [asyncResp, certFile, objectPath, service, certURI, id,
+            [asyncResp, certFile, objectPath, service, url{*parsedUrl}, id,
              name](const boost::system::error_code ec) {
             if (ec)
             {
@@ -825,8 +826,8 @@
                 messages::internalError(asyncResp->res);
                 return;
             }
-            getCertificateProperties(asyncResp, objectPath, service, id,
-                                     certURI, name);
+            getCertificateProperties(asyncResp, objectPath, service, id, url,
+                                     name);
             BMCWEB_LOG_DEBUG << "HTTPS certificate install file="
                              << certFile->getCertFilePath();
             },
@@ -846,26 +847,26 @@
         app,
         "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/<str>/")
         .privileges(redfish::privileges::getCertificate)
-        .methods(
-            boost::beast::http::verb::
-                get)([&app](const crow::Request& req,
-                            const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                            const std::string& id) -> void {
-            if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-            {
-                return;
-            }
+        .methods(boost::beast::http::verb::get)(
+            [&app](const crow::Request& req,
+                   const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                   const std::string& id) -> void {
+                if (!redfish::setUpRedfishRoute(app, req, asyncResp))
+                {
+                    return;
+                }
 
-            BMCWEB_LOG_DEBUG << "HTTPS Certificate ID=" << id;
-            std::string certURL =
-                "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/" +
-                id;
-            std::string objPath =
-                sdbusplus::message::object_path(certs::httpsObjectPath) / id;
-            getCertificateProperties(asyncResp, objPath,
-                                     certs::httpsServiceName, id, certURL,
-                                     "HTTPS Certificate");
-        });
+                BMCWEB_LOG_DEBUG << "HTTPS Certificate ID=" << id;
+                const boost::urls::url certURL = crow::utility::urlFromPieces(
+                    "redfish", "v1", "Managers", "bmc", "NetworkProtocol",
+                    "HTTPS", "Certificates", id);
+                std::string objPath =
+                    sdbusplus::message::object_path(certs::httpsObjectPath) /
+                    id;
+                getCertificateProperties(asyncResp, objPath,
+                                         certs::httpsServiceName, id, certURL,
+                                         "HTTPS Certificate");
+            });
 }
 
 /**
@@ -936,9 +937,9 @@
 
             sdbusplus::message::object_path path(objectPath);
             std::string certId = path.filename();
-            std::string certURL =
-                "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/" +
-                certId;
+            const boost::urls::url certURL = crow::utility::urlFromPieces(
+                "redfish", "v1", "Managers", "bmc", "NetworkProtocol", "HTTPS",
+                "Certificates", certId);
             getCertificateProperties(asyncResp, objectPath,
                                      certs::httpsServiceName, certId, certURL,
                                      "HTTPS Certificate");
@@ -1043,8 +1044,9 @@
 
             sdbusplus::message::object_path path(objectPath);
             std::string certId = path.filename();
-            std::string certURL =
-                "/redfish/v1/AccountService/LDAP/Certificates/" + certId;
+            const boost::urls::url certURL =
+                crow::utility::urlFromPieces("redfish", "v1", "AccountService",
+                                             "LDAP", "Certificates", certId);
             getCertificateProperties(asyncResp, objectPath,
                                      certs::ldapServiceName, certId, certURL,
                                      "LDAP Certificate");
@@ -1074,8 +1076,8 @@
         }
 
         BMCWEB_LOG_DEBUG << "LDAP Certificate ID=" << id;
-        std::string certURL =
-            "/redfish/v1/AccountService/LDAP/Certificates/" + id;
+        const boost::urls::url certURL = crow::utility::urlFromPieces(
+            "redfish", "v1", "AccountService", "LDAP", "Certificates", id);
         std::string objPath =
             sdbusplus::message::object_path(certs::ldapObjectPath) / id;
         getCertificateProperties(asyncResp, objPath, certs::ldapServiceName, id,
@@ -1142,8 +1144,9 @@
 
             sdbusplus::message::object_path path(objectPath);
             std::string certId = path.filename();
-            std::string certURL =
-                "/redfish/v1/Managers/bmc/Truststore/Certificates/" + certId;
+            const boost::urls::url certURL = crow::utility::urlFromPieces(
+                "redfish", "v1", "Managers", "bmc", "Truststore",
+                "Certificates", certId);
             getCertificateProperties(asyncResp, objectPath,
                                      certs::authorityServiceName, certId,
                                      certURL, "TrustStore Certificate");
@@ -1173,8 +1176,9 @@
         }
 
         BMCWEB_LOG_DEBUG << "Truststore Certificate ID=" << id;
-        std::string certURL =
-            "/redfish/v1/Managers/bmc/Truststore/Certificates/" + id;
+        const boost::urls::url certURL =
+            crow::utility::urlFromPieces("redfish", "v1", "Managers", "bmc",
+                                         "Truststore", "Certificates", id);
         std::string objPath =
             sdbusplus::message::object_path(certs::authorityObjectPath) / id;
         getCertificateProperties(asyncResp, objPath,
