certauth | Simple CertificateAuthority and host certificate creation
kandi X-RAY | certauth Summary
kandi X-RAY | certauth Summary
Simple CertificateAuthority and host certificate creation, useful for man-in-the-middle HTTPS proxy
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Load and store a certificate
- Generates a host certificate
- Get the domain of a host
- Check if host is an IP address
- Make a certificate
- Return the contents of the given host
- Read certificate from file
- Dump a private key and certificate
- Return the key for a given host
- Load the root certificate
- Generate a root certificate
certauth Key Features
certauth Examples and Code Snippets
Community Discussions
Trending Discussions on certauth
QUESTION
I need to use gRPC for bi-directional streaming, where the client is a .Net Framework project, which due to legacy stuff, can't be upgraded to .NET5+.
When reading microsoft documentation, i can see that the WinHttpHandler should be used (https://docs.microsoft.com/en-us/aspnet/core/grpc/netstandard?view=aspnetcore-5.0).
But i seem to have an issue using SSL with this setup, does anybody have a suggestion to what can be done to solve this issue?
I get the following error:
"InvalidOperationException: SslCredentials with non-null arguments is not supported by GrpcChannel. GrpcChannel uses HttpClient to make gRPC calls and HttpClient automatically loads root certificates from the operating system certificate store. Client certificates should be configured on HttpClient. See https://aka.ms/aspnet/grpc/certauth for details."
My server is setup with the following setup:
...ANSWER
Answered 2021-Nov-03 at 15:59Probably something along the following lines (rough draft) should work:
QUESTION
I have been trying to setup a new ADFS server and the configuration is failing with the following error: The SSL certificate subject alternative names do not support host name 'certauth.sts.domain.com'. Configuring certificate authentication binding on port '49443' and hostname 'sts.domain.com'.
It ends with "The server is not operational."
I have reinstalled, disabled carbon black and checked the firewall but nothing has helped so far. Any ideas?
...ANSWER
Answered 2021-Oct-27 at 10:11• You are encountering the error because the subject name and subject alternative name in the SSL certificate installed, should be the same as the federation service name that is set while configuring ADFS role on the server. Since, that certificate only contains ‘sts.domain.com’ as the federation service name which is ultimately the subject name defined on the certificate and does not contain ‘certificate.sts.domain.com’ as a subject alternative name, thus, due to which you are encountering this error. Please find the below screenshot of the ADFS post-install configuration for your reference: -
• As in Windows Server 2019, the ADFS setup by default installs ADFS role on port 443 using the same certificate with SAN (subject alternative name) on different hosts. Thus, you need to update your certificate to support SAN and configure it accordingly. Please find the below command to update certificate SAN binding on the same port, i.e., 443 with different hosts: -
QUESTION
I would like to authenticate clients connecting to my ASP.NET Core Web API (.NET 5) running on Kestrel using certificate-based authentication.
In my Startup.cs
I have the following in ConfigureServices
:
ANSWER
Answered 2021-Jun-28 at 02:30Ok, so in the end I was able to solve my own problem. There were two different parts to solving it, but ultimately it only required a few small modifications to my project code.
Recognizing client certificates
Firstly, the server was not recognizing the self-signed client certificates as valid certificates. This can be solved by either 1. adding all of the client certificates (or a root CA that signs them all) to the trusted certificate store of the operating system or 2. adding a ClientCertificateValidation
callback to kestrel to determine whether or not a certificate is accepted or rejected.
Example of #2 (an adjustment to the ConfigureHttpsDefaults
lambda in Program.cs
) is below:
QUESTION
When implementing Mutual TLS using https://docs.microsoft.com/en-us/aspnet/core/security/authentication/certauth?view=aspnetcore-5.0 I see they are comparing the thumbprint of the client certificate to the thumbprint of the server certificate. But are these always guaranteed to be the same in production? Doesn't one only contain the public key and the other contains both the private and public keys? And if that was the case, wouldn't they have different thumbprints?
...ANSWER
Answered 2021-Jun-03 at 19:36I found your point there and here is the answer, one paragraph before
Because the same self-signed certificate is used in this example, ensure that only your certificate can be used.
for some reason they chose to use same certificate for server and client (maybe for simplicity?) which is indeed a *BAD* practice in real world. Sharing same certificate between different entities never was a good idea. Client and server certificates must be different.
Certificate-based client authentication is more difficult, because you need to have a an account directory to validate client certificate against. For example, Active Directory. This directory should implement certificate <-> principal
mapping. When you receive the certificate, you search for principal in directory and if found, you can uniquely distinguish clients, validate their permissions, rights and perform logging.
If no mapping found -- reject authentication, because you don't know the client.
If you don't care in distinguishing clients, then you clearly don't need mutual authentication.
And never hardcore client certificates/thumbprints in code, because they are periodically changed, therefore external account directory (which is updated using out-of-band process) is necessary.
Though, you can implement the logic when arbitrary clients can connect to your server only when they have certificate issued by your private CA. It is valid scenario. In this case, you don't need external account directory and you validate that client certificate is issued by exact, or by one of pre-defined CAs in the list, then you allow subsequent communication. But they still are anonymous to your system.
Edits based on your additions:
If your case fits last paragraph, then:
- validate general chain (i.e. time validity, extensions, revocation, etc.)
- validate that immediate issuer is in the explicit list of approved by you CAs (private)
QUESTION
I have installed a FreeIPA master server including Kerberos. Furthermore I have one client server, enrolled in FreeIPA, to test the PKINIT feature of Kerberos. All servers run on CentOS7.
A testuser exists in FreeIPA and this user is also listed in the one and only existing realm, when using list_principals
in kadmin
as testuser@REALMNAME.
getprinc testuser
also gives Attributes: REQUIRES_PRE_AUTH
.
I have created kdc and client certificates strictly following the documentation: https://web.mit.edu/kerberos/www/krb5-latest/doc/admin/pkinit.html. They have been signed by my own CA, whose certificate is also present on the client and the master.
The [realm] config on the master is as follows:
...ANSWER
Answered 2021-May-21 at 11:33Here is a blog post I put together that should give you an idea how to setup Kerberos PKINIT preauthentication mechanism to authenticate an IPA user with a X.509 certificate:
QUESTION
I need to implement Client Certificate authentication on some of the endpoints in my .NET 5 Web API. So I don't want to enable HTTPS across all endpoint as described here in the MS docs. I am using Kestrel on my local machine and not IIS express or IIS.
I have tried the following three methods with no luck on either of them:
...ANSWER
Answered 2021-Apr-21 at 09:59You need to configure Kestrel to allow client certificates in the program.cs
The default value is ClientCertificateMode.NoCertificate
so in your ConfigureWebHostDefaults
you need to change that to ClientCertificateMode.AllowCertificate
.
Here's an edited chunk of code from the docs you sent where I did that:
QUESTION
[Target netcoreapp3.1]
Hi there! So I have this Web Api that is protected by a middleware of this form in my Startup.cs:
...ANSWER
Answered 2020-Jun-19 at 20:14Hope what follows will help someone! I eventually found this link : https://docs.microsoft.com/en-us/aspnet/core/security/authorization/limitingidentitybyscheme?view=aspnetcore-3.1
It explains how to implement multiple authorization policies that both have a chance to succeed. Below is the solution I found using IIS after a bit more research:
Startup.cs
QUESTION
I have followed this documentation (https://docs.microsoft.com/en-us/aspnet/core/security/authentication/certauth?view=aspnetcore-3.1) to implement an authentication by certificat in my .net core 3.1 API. Everything works fine when I call my API on localhost, but I continously get an error 403 once the API is deployed on Azure. I have no idea of what happens as there is no additional information on logs. I just don't understand what causes the 403
As I understand, when I call my API routes I have to provide the certificate inside the "X-ARR-ClientCert" header, which is working fine locally, but seems not being interpreted on Azure.
Am I missing something ? Do I need to set a specific setting on my App Service ?
...ANSWER
Answered 2020-Feb-14 at 12:02As the article said, if the correct certificate is sent to the server, the data is returned. If no certificate or the wrong certificate
is sent, an HTTP 403 status code is returned.
So, as Bhushan said, confirm your certificate has uploaded to azure app service.
When you enable mutual auth for your application, all paths under the root of your app will require a client certificate for access. Exclusion paths can be configured by selecting Configuration
> General Settings
and defining an exclusion path.
For more details, you could refer to this article.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install certauth
You can use certauth like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page