Client Certificate issues

24 views
Skip to first unread message

Luke Eccleston

unread,
Oct 22, 2021, 4:09:50 PM10/22/21
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?





Oren Eini (Ayende Rahien)

unread,
Oct 22, 2021, 4:50:19 PM10/22/21
to ravendb
In most cases, that means that there is something in the middle between your application and the server that does TLS termination, or the like.
Are you running in a corporate environment? Is there a network appliance that may be doing that?
I outlined the reasoning behind the X509 decision here: https://ayende.com/blog/178977/ravendb-4-0-securing-the-keys-to-the-kingdom

--
You received this message because you are subscribed to the Google Groups "RavenDB - an awesome database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/5eddcdfb-25d9-47dc-a2b5-f613effa8327n%40googlegroups.com.


--
Oren Eini
CEO   /   Hibernating Rhinos LTD
Skype:  ayenderahien
Support:  sup...@ravendb.net
  
Reply all
Reply to author
Forward
0 new messages