Client Certificate issues

18 views
Skip to first unread message

Gilbert E. Smalls

unread,
Oct 22, 2024, 1:57:40 AM10/22/24
to RavenDB - an awesome database
Can tell me what in the world I'm doing wrong with trying to create my certificate so  I can store it in app settings?

This line works fine

var cert = new X509Certificate2("client.certificate.pfx");

However, when I try to just get the raw data, by just using this certificate

var stringOfCert = Convert.ToBase64String(cert.RawData);

Certificate = new X509Certificate2(Convert.FromBase64String( stringOfCert  ), password)

I get the following error

{"Type":"InvalidAuth","Message":"This server requires client certificate for authentication, but none was provided by the client."}

The password is from the "PASSWORD" file downloaded as part of the certificate

There doesn't seem to any documentation on this that doesn't involve me having to commit a .pfx file.

Any idea why it can't just use connection strings like MongoDb ect?

Paweł Pekról

unread,
Oct 22, 2024, 3:43:45 AM10/22/24
to RavenDB - an awesome database
Hi,


How are you hosting this application? Have you tried passing UserKeySet or MachineKeySet to the ctor of the certificate?

Reply all
Reply to author
Forward
0 new messages