'SSL Self-Signed certificate not trusted by ASP.Net app

I have an ASP.Net app that requires SSL certification in order to connect to a Dynamics NAV instance via SOAP.

I've created a self signed SSL certificate using the New-SelfSignedCertificateEx.ps1 script. The exact command used was:

New-SelfSignedCertificateEx -Subject "CN=<computerHostname>" -IsCA $true -Exportable -StoreLocation LocalMachine -NotAfter $([datetime]::now.AddYears(5))

Afterwards I copied the certificate to Trusted Root Certificates and added the thumbprint in the NAV instance settings, yet every time I try to connect my app to said NAV instance I receive an error stating:

System.ServiceModel.Security.SecurityNegotiationException: Could not establish trust relationship for the SSL/TLS secure channel with authority '<computerHostname>:<NavInstanceSOAPPort>'



Solution 1:[1]

A self signed certificate is not a trusted certificate, you need to provide one from a trusted authority

Try Let's Encrypt, ZeroSSL, FreeSSL or any party you like, they will offer you free 90-day certificate good enough for your tests

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vega_gf