# Is it possible to make Hangfire connect to DB via SSL (using ceritifcate)

**URL:** <https://discuss.hangfire.io/t/is-it-possible-to-make-hangfire-connect-to-db-via-ssl-using-ceritifcate/6295>\
**Category:** question\
**Tags:** postgres, dashboard\
**Created:** [June 19, 2019, 2:21pm UTC](https://discuss.hangfire.io/t/is-it-possible-to-make-hangfire-connect-to-db-via-ssl-using-ceritifcate/6295 "2019-06-19T14:21:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lansman](https://avatars.discourse-cdn.com/v4/letter/l/eada6e/32.png) [@lansman](https://discuss.hangfire.io/u/lansman)\
**Post date:** [June 19, 2019, 2:21pm UTC](https://discuss.hangfire.io/t/is-it-possible-to-make-hangfire-connect-to-db-via-ssl-using-ceritifcate/6295/1 "2019-06-19T14:21:22Z")

</div>

I have Webapi project. I register by DbContext (provided by Entity Framework) with custom methods ProvideClientCertificatesCallback and RemoteCertificateValidationCallback where i do validating of my self-signed ceritifcate.

public void ConfigureServices(IServiceCollection services)  
{  
services.AddDbContextPool((provider, dop) =\>  
{  
var dbOptionsReader = provider.GetService();  
dop.UseNpgsql(dbOptionsReader.ReadConnectionString(),  
noa =\>  
{  
noa.ProvideClientCertificatesCallback(dbOptionsReader.AddSslCertificate);  
noa.RemoteCertificateValidationCallback(dbOptionsReader.VerifySslManually);  
});  
});

```
        services.AddHangfire((provider, config) =>
        {
            var dbOptionsReader = provider.GetService<DbConnectionOptionsReader>();
            config.UsePostgreSqlStorage(dbOptionsReader.ReadConnectionString());
        });

```

}

When i added Hangfire to project - UsePostgreSqlStorage falls with error **The remote certificate is invalid according to the validation procedure.** Allright, Hangifre doesnt know anything about my custom ceritficate check logic. Is it possible to make it understand such logic?
