Skip to content

TLS on ASP.NET5.0 #1236

Answered by eantunes1980
eantunes1980 asked this question in Q&A
Sep 10, 2021 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

Sorry for the late answer. This works for me now. The Problem was missing second "l.UseHttps()". Commented below.

private IWebHost BuildWebHost(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseKestrel((context, o) =>
                {
                    o.ListenAnyIP(Options.Port); // default http pipeline 
                    if (Options.UseSSL)
                    {
                        o.ConfigureHttpsDefaults(o =>
                        {
                            o.ClientCertificateMode = ClientCertificateMode.NoCertificate;
                            o.ServerCertificate = Options.SSLCertificate;
                        });
                …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@eantunes1980
Comment options

@SeppPenner
Comment options

@eantunes1980
Comment options

@behroozbc
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by eantunes1980
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants