see on GitHub

Client API : Setting up Authentication and Authorization

Authentication and authorization is based on client X.509 certificates.

The Certificate property allows you to pass a certificate which will be used by the RavenDB client to connect to a server.


If your RavenDB instance is running on 'https', then your application has to use a client certificate in order to be able to access the server. You can find more information here.


// load certificate
X509Certificate2 clientCertificate = new X509Certificate2("C:\\path_to_your_pfx_file\\cert.pfx");

using (IDocumentStore store = new DocumentStore()
    Certificate = clientCertificate,
    Database = "Northwind",
    Urls = new[] {"https://my_secured_raven"}
    // do your work here