{"id":90110,"date":"2023-06-07T07:00:42","date_gmt":"2023-06-07T05:00:42","guid":{"rendered":"https:\/\/code-maze.com\/?p=90110"},"modified":"2023-06-07T07:52:39","modified_gmt":"2023-06-07T05:52:39","slug":"enable-ssl-certificate-visual-studio-dotnet-cli","status":"publish","type":"post","link":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/","title":{"rendered":"How To Set Up SSL Certificate In Visual Studio and .NET CLI"},"content":{"rendered":"<p>In this article, we&#8217;ll look at setting up an SSL certificate for use in ASP.NET web applications and creating a new SSL certificate using Visual Studio and the .NET CLI. We&#8217;ll also look at how to remove SSL certificates using the Windows certificate manager and the .NET CLI. Finally, we&#8217;ll cover some common problems and investigate how to troubleshoot them.\u00a0<\/p>\n<div style=\"padding: 20px; border-left: 5px #dc2323 solid; display: block; margin-bottom: 20px; box-shadow: 1px 1px 5px 0px lightgrey;\">To download the source code for this article, you can visit our <a href=\"https:\/\/github.com\/CodeMazeBlog\/CodeMazeGuides\/tree\/main\/aspnetcore-features\/HowToSetupDeveloperHttpsCertificate\" target=\"_blank\" rel=\"nofollow noopener\">GitHub repository<\/a>.<\/div>\n<p>Let&#8217;s start.<\/p>\n<h2>How to Create an SSL Certificate From a Fresh Visual Studio Installation<\/h2>\n<p>We may or may not already have an SSL certificate set up after installing Visual Studio. <strong>Visual Studio allows us to install it if we don&#8217;t have an SSL certificate installed.<\/strong><\/p>\n<h3>Creating a New Project With HTTPS Enabled<\/h3>\n<p>Let&#8217;s create a new Web API project and make sure that HTTPS is enabled:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/project-setup-https-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-90112\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/project-setup-https-1.png\" alt=\"Visual Studio project setup additional information step\" width=\"800\" height=\"533\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/project-setup-https-1.png 800w, https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/project-setup-https-1-300x200.png 300w, https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/project-setup-https-1-768x512.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>Visual Studio uses a project template set up to use SSL because the &#8220;Configure for HTTPS&#8221; option is checked. We&#8217;ll keep the other options at their default values.<\/p>\n<p>Visual Studio has a &#8220;Start Debugging button&#8221; on the toolbar, identifiable by the green triangle. We can see the launch profiles configured by pressing the down arrow. This allows us to select and run the application using different launch profiles:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/profiles-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-90113\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/profiles-1.png\" alt=\"Visual Studio run profiles\" width=\"500\" height=\"256\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/profiles-1.png 500w, https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/profiles-1-300x154.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p>Let&#8217;s open the <code>launchSettings.json<\/code>\u00a0file and look at how the &#8220;https&#8221; profile is configured:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\">\"https\": {\r\n  \"commandName\": \"Project\",\r\n  \"dotnetRunMessages\": true,\r\n  \"launchBrowser\": true,\r\n  \"launchUrl\": \"swagger\",\r\n  \"applicationUrl\": \"https:\/\/localhost:7175;http:\/\/localhost:5199\",\r\n  \"environmentVariables\": {\r\n    \"ASPNETCORE_ENVIRONMENT\": \"Development\"\r\n  }\r\n}<\/pre>\n<p>The most important part of the &#8220;https&#8221; profile is the <code>applicationUrl<\/code> property. It has 2 URLs separated by a semicolon: an HTTP URL, and an HTTPS URL.<\/p>\n<p>Both URLs will be available when we run the application with the &#8220;https&#8221; profile. The application is configured to redirect to HTTPS in the <code>Program.cs<\/code> file, so if we attempt to access the HTTP URL, we&#8217;ll be redirected to the HTTPS URL:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">app.UseHttpsRedirection();<\/code><\/p>\n<p>This <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/microsoft.aspnetcore.builder.httpspolicybuilderextensions.usehttpsredirection?view=aspnetcore-7.0\" target=\"_blank\" rel=\"nofollow noopener\">method<\/a> will add a <a href=\"https:\/\/code-maze.com\/working-with-asp-net-core-middleware\/\" target=\"_blank\" rel=\"noopener\">middleware<\/a> to the pipeline, redirecting HTTP requests to the HTTPS URL.<\/p>\n<h3>Installing the SSL Certificate in Visual Studio<\/h3>\n<p>Let&#8217;s run our application.<\/p>\n<p><strong>If we already have an SSL certificate set up on our machine, the application will run, and we&#8217;ll be able to navigate to our application&#8217;s web pages or make a request to its API endpoints via HTTPS.<\/strong><\/p>\n<p>Visual Studio will prompt us to set up an SSL certificate on our machine if there isn&#8217;t one already. It will generate a self-signed certificate, and we&#8217;ll receive a prompt asking if we want to trust it:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/https-prompt.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-90114\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/https-prompt.png\" alt=\"ASP NET Core generated SSL certificate prompt \" width=\"500\" height=\"187\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/https-prompt.png 500w, https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/https-prompt-300x112.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p>We select &#8220;Yes&#8221; to trust the certificate that ASP.NET Core generated for us. This will cause another prompt to appear for us to install the certificate:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/vs-cert-security-warning-screenshot-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-90115\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/vs-cert-security-warning-screenshot-1.png\" alt=\"Install SSL certificate prompt\" width=\"412\" height=\"380\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/vs-cert-security-warning-screenshot-1.png 412w, https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/vs-cert-security-warning-screenshot-1-300x277.png 300w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><\/a><\/p>\n<p><strong>We should be careful about which certificates we install on our machines and be confident that they do come from the certificate authority (CA) they claim to represent.<\/strong><\/p>\n<p>In this case, the CA is for localhost, the hostname for our local machine. ASP.NET Core generated this certificate to select &#8220;Yes&#8221; and install the certificate safely.<\/p>\n<p>The certificate should then be installed, and the application should run using HTTPS:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/swagger-https-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-90116 size-full\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/swagger-https-3.png\" alt=\"Swagger running with HTTPS after implemented SSL certificate\" width=\"500\" height=\"153\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/swagger-https-3.png 500w, https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/swagger-https-3-300x92.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<h2>How to Create an SSL Certificate Using the Command Line<\/h2>\n<p>Another way to generate an SSL certificate without Visual Studio is to use the <a href=\"https:\/\/code-maze.com\/csharp-execute-cli-applications\/\" target=\"_blank\" rel=\"noopener\">.NET CLI<\/a>.<\/p>\n<p><strong>The .NET CLI provides commands that allow us to manipulate SSL certificates. <\/strong>We can check that they exist or are trusted, and we can create or remove them too:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">dotnet dev-certs https<\/code><\/p>\n<p>Let&#8217;s check to make sure we don&#8217;t already have an SSL certificate setup:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">dotnet dev-certs https --check<\/code><\/p>\n<p>If there is already an SSL certificate in the current user&#8217;s certificate store, then the command will return a message:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">A valid HTTPS certificate is already present.<\/code><\/p>\n<p>If we already have an SSL certificate setup but want to create a new one, we should remove the old one first. We&#8217;ll discuss how to remove it in a later section.<\/p>\n<p>Let&#8217;s use the .NET CLI and create and trust a new self-signed SSL certificate:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">dotnet dev-certs https --trust<\/code><\/p>\n<p>The <code>dotnet dev-certs https<\/code> part of the command installs a new self-signed SSL certificate. The <code>--trust<\/code> flag is what trusts the certificate on the local machine.\u00a0<\/p>\n<p>After running this command, we should get the prompt asking if we want to install the SSL certificate. We select &#8220;Yes&#8221; to confirm the installation of the certificate.<\/p>\n<p>The Web API application should now run with the &#8220;https&#8221; profile and give access to everything via HTTPS.<\/p>\n<h2>How to Remove an SSL Certificate<\/h2>\n<p>We may want to remove an SSL certificate if it&#8217;s broken or malformed before creating a new one.<\/p>\n<h3>How to Remove an SSL Certificate Using the Certificate Manager<\/h3>\n<p>Let&#8217;s remove our developer SSL certificate using the Windows certificate manager. To open the certificate manager, let&#8217;s use the &#8220;Run&#8221; application by either searching in the Windows search bar or pressing the Windows + R keys together:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/run.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-90117\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/run.png\" alt=\"Windows Run application\" width=\"500\" height=\"284\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/run.png 500w, https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/run-300x170.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p>Let&#8217;s type &#8220;certmgr.msc&#8221; in the textbox and select the &#8220;OK&#8221; button. This should open the Certificate Manager application:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/certmgr-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-90118\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/certmgr-2.png\" alt=\"Localhost certificate in Certificate Manager application\" width=\"500\" height=\"188\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/certmgr-2.png 500w, https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/certmgr-2-300x113.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p>Our localhost certificate will be located under, <em>Certificates &#8211; Current User &gt; Personal &gt; Certificates<\/em>. Let&#8217;s select the localhost certificate and delete it by right-clicking and selecting &#8220;Delete&#8221;.<\/p>\n<p>After confirming the certificate deletion, it shouldn&#8217;t appear in the list. We can now set up a new self-signed SSL certificate using Visual Studio or the .NET CLI.<\/p>\n<h3>How to Remove an SSL Certificate Using the Command Line<\/h3>\n<p>The .NET CLI also allows us to remove an ASP.NET Core SSL certificate by using the <code>--clean<\/code> flag.<\/p>\n<p>Let&#8217;s remove our SSL certificates:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">dotnet dev-certs https --clean<\/code><\/p>\n<p>The user&#8217;s certificate store has had all of our development certificates removed. Running the <code>dotnet dev-certs https --check<\/code> command will confirm that our certificate store no longer has an SSL certificate.<\/p>\n<h2>Troubleshooting<\/h2>\n<p><strong>Sometimes we can run into unexpected issues when creating and removing SSL certificates<\/strong>. We&#8217;ll look at some common issues we might face and find out what troubleshooting steps we can take.<\/p>\n<p><code>Browser Error - NET::ERR_CERT_AUTHORITY_INVALID<\/code><\/p>\n<p><strong>This error occurs when there&#8217;s an SSL certificate installed on our machine, but it&#8217;s not trusted.<\/strong> We can trust the certificate by using the .NET CLI and running the command <code>dotnet dev-certs https --trust<\/code>.\u00a0<\/p>\n<p><code>Browser Error - NET::ERR_CERT_INVALID<\/code><\/p>\n<p><strong>We get this error when the browser thinks the SSL certificate is invalid.<\/strong> This may be because it can&#8217;t validate the certificate against the certificate authority. We can confirm if this is a problem by opening the Certificate Manager. Then we need to check if there&#8217;s more than one localhost row in, <em>Certificates &#8211; Current User &gt; Trusted Root Certification Authority &gt; Certificates:<\/em><\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/multiple-localhost-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-90119\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/multiple-localhost-2.png\" alt=\"Certificate manager with more than 1 localhost row\" width=\"850\" height=\"478\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/multiple-localhost-2.png 850w, https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/multiple-localhost-2-300x169.png 300w, https:\/\/code-maze.com\/wp-content\/uploads\/2023\/06\/multiple-localhost-2-768x432.png 768w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/a><\/p>\n<p>If we do have more than 1 row for localhost, we should run the .NET CLI command, <code>dotnet dev-certs https --clean<\/code> and then manually remove the localhost rows in the Windows certificate manager application under <em>Certificates &#8211; Current User &gt; Trusted Root Certification Authority &gt; Certificates<\/em>.<\/p>\n<h3>Visual Studio Prompt to Add Certificate Not Appearing After Removing SSL Certificate Using the CLI<\/h3>\n<p>Manually check the certificate has been removed using the Certificate Manager or by running the .NET CLI command, <code>dotnet dev-certs https<\/code>. After confirming that, restart Visual Studio, and the prompt should appear when attempting to run the application.<\/p>\n<h2>Conclusion<\/h2>\n<p>In this article, we&#8217;ve looked at how to set up a self-signed developer SSL certificate to run our ASP.NET applications locally via HTTPS using Visual Studio. We also learned how to generate an SSL certificate using the .NET CLI. Then we looked at how to remove any locally installed SSL certificates when they&#8217;ve become broken somehow by using the Windows certificate manager and the .NET CLI. Finally, we looked at common errors around creating and removing local SSL certificates and how we can troubleshoot them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we&#8217;ll look at setting up an SSL certificate for use in ASP.NET web applications and creating a new SSL certificate using Visual Studio and the .NET CLI. We&#8217;ll also look at how to remove SSL certificates using the Windows certificate manager and the .NET CLI. Finally, we&#8217;ll cover some common problems and [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":62189,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[171],"tags":[79,1822,998,14,1821,39,45],"class_list":["post-90110","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-http","tag-asp-net-core","tag-certificate","tag-cli","tag-http","tag-ssl","tag-visual-studio","tag-web-development","et-has-post-format-content","et_post_format-et-post-format-standard"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Set Up SSL Certificate In Visual Studio and .NET CLI<\/title>\n<meta name=\"description\" content=\"This article will look at setting up and removing an SSL certificate using Visual Studio and .NET CLI. We&#039;ll also cover some common problems.\u00a0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Set Up SSL Certificate In Visual Studio and .NET CLI\" \/>\n<meta property=\"og:description\" content=\"This article will look at setting up and removing an SSL certificate using Visual Studio and .NET CLI. We&#039;ll also cover some common problems.\u00a0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/\" \/>\n<meta property=\"og:site_name\" content=\"Code Maze\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-07T05:00:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-07T05:52:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Code Maze\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/CodeMazeBlog\" \/>\n<meta name=\"twitter:site\" content=\"@CodeMazeBlog\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Code Maze\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/\"},\"author\":{\"name\":\"Code Maze\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\"},\"headline\":\"How To Set Up SSL Certificate In Visual Studio and .NET CLI\",\"datePublished\":\"2023-06-07T05:00:42+00:00\",\"dateModified\":\"2023-06-07T05:52:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/\"},\"wordCount\":1241,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"keywords\":[\"asp.net core\",\"certificate\",\"CLI\",\"HTTP\",\"ssl\",\"Visual Studio\",\"web development\"],\"articleSection\":[\"HTTP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/\",\"url\":\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/\",\"name\":\"How To Set Up SSL Certificate In Visual Studio and .NET CLI\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"datePublished\":\"2023-06-07T05:00:42+00:00\",\"dateModified\":\"2023-06-07T05:52:39+00:00\",\"description\":\"This article will look at setting up and removing an SSL certificate using Visual Studio and .NET CLI. We'll also cover some common problems.\u00a0\",\"breadcrumb\":{\"@id\":\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#primaryimage\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"width\":1100,\"height\":620,\"caption\":\"C# Development\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/code-maze.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Set Up SSL Certificate In Visual Studio and .NET CLI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/code-maze.com\/#website\",\"url\":\"https:\/\/code-maze.com\/\",\"name\":\"Code Maze\",\"description\":\"Learn. Code. Succeed.\",\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/code-maze.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/code-maze.com\/#organization\",\"name\":\"Code Maze\",\"url\":\"https:\/\/code-maze.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"width\":3511,\"height\":3510,\"caption\":\"Code Maze\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/CodeMazeBlog\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\",\"name\":\"Code Maze\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"caption\":\"Code Maze\"},\"description\":\"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/codemaze\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog\"],\"url\":\"https:\/\/code-maze.com\/author\/codemazecontributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Set Up SSL Certificate In Visual Studio and .NET CLI","description":"This article will look at setting up and removing an SSL certificate using Visual Studio and .NET CLI. We'll also cover some common problems.\u00a0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/","og_locale":"en_US","og_type":"article","og_title":"How To Set Up SSL Certificate In Visual Studio and .NET CLI","og_description":"This article will look at setting up and removing an SSL certificate using Visual Studio and .NET CLI. We'll also cover some common problems.\u00a0","og_url":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/","og_site_name":"Code Maze","article_published_time":"2023-06-07T05:00:42+00:00","article_modified_time":"2023-06-07T05:52:39+00:00","og_image":[{"width":1100,"height":620,"url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","type":"image\/png"}],"author":"Code Maze","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/CodeMazeBlog","twitter_site":"@CodeMazeBlog","twitter_misc":{"Written by":"Code Maze","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#article","isPartOf":{"@id":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/"},"author":{"name":"Code Maze","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04"},"headline":"How To Set Up SSL Certificate In Visual Studio and .NET CLI","datePublished":"2023-06-07T05:00:42+00:00","dateModified":"2023-06-07T05:52:39+00:00","mainEntityOfPage":{"@id":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/"},"wordCount":1241,"commentCount":1,"publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"image":{"@id":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","keywords":["asp.net core","certificate","CLI","HTTP","ssl","Visual Studio","web development"],"articleSection":["HTTP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/","url":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/","name":"How To Set Up SSL Certificate In Visual Studio and .NET CLI","isPartOf":{"@id":"https:\/\/code-maze.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#primaryimage"},"image":{"@id":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","datePublished":"2023-06-07T05:00:42+00:00","dateModified":"2023-06-07T05:52:39+00:00","description":"This article will look at setting up and removing an SSL certificate using Visual Studio and .NET CLI. We'll also cover some common problems.\u00a0","breadcrumb":{"@id":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#primaryimage","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","width":1100,"height":620,"caption":"C# Development"},{"@type":"BreadcrumbList","@id":"https:\/\/code-maze.com\/enable-ssl-certificate-visual-studio-dotnet-cli\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/code-maze.com\/"},{"@type":"ListItem","position":2,"name":"How To Set Up SSL Certificate In Visual Studio and .NET CLI"}]},{"@type":"WebSite","@id":"https:\/\/code-maze.com\/#website","url":"https:\/\/code-maze.com\/","name":"Code Maze","description":"Learn. Code. Succeed.","publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/code-maze.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/code-maze.com\/#organization","name":"Code Maze","url":"https:\/\/code-maze.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","width":3511,"height":3510,"caption":"Code Maze"},"image":{"@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/CodeMazeBlog"]},{"@type":"Person","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04","name":"Code Maze","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/person\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","caption":"Code Maze"},"description":"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.","sameAs":["https:\/\/www.linkedin.com\/company\/codemaze\/","https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog"],"url":"https:\/\/code-maze.com\/author\/codemazecontributor\/"}]}},"_links":{"self":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/90110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/comments?post=90110"}],"version-history":[{"count":5,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/90110\/revisions"}],"predecessor-version":[{"id":90126,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/90110\/revisions\/90126"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media\/62189"}],"wp:attachment":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media?parent=90110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/categories?post=90110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/tags?post=90110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}