Neteyes
Neteyes
CC#
Created by Neteyes on 5/24/2023 in #help
❔ Custom cert validation in http client
I have a HttpClient with a SocketsHttpHandler that I'm trying to add a custom certificate to, because I'm talking to a service that requires it. I'm hitting some issues though, after adding the certificate through handler.SslOptions.ClientCertificates.Add(cert);I'm getting an "unknown certificate" error. Removing the Client Certificate just gives me the "bad certificate" error. So, I thought I'll add the Root CA as well, maybe that's the issue right? But I cannot get the callback on RemoteCertificateValidationCallbackto fire at all. From what I can gather, what's happening is that the ClientCertificate cannot be validated because it's signed by an untrusted Root CA, but since RemoteCertificateValidationCallback isnt being fired, how can I determine if it should be trusted or not? Same result if I just make it a HttpHandler instead. Any ideas here?
7 replies
CC#
Created by Neteyes on 9/27/2022 in #help
.Net 6 on IIS (Port conflict)
Hey! I have an application that I would like to run on port 8081, and it does use port 8081 in startup, in UseUrls(). But I can't get it to run through IIS on the same port because obviously I get a conflict. But the issue is that no other port works either. I've put IIS on port 8082, my app runs 8081. In the stdout i get a log that app is started on 8081, but IIS it seems can't access the site, so the binding on 8082 times out. Any ideas to help here? I realize that I should run things on port 80, but it's not an option in this specific case sadly. This is with dotnet publish and the .net6 hosting bundle
3 replies