Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
azygis committed Sep 25, 2023
1 parent 495ec00 commit ae22240
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ In `Startup.cs` _ConfigureServices(IServiceCollection services)_ method add the

```csharp
services.AddHangfire(config =>
config.UsePostgreSqlStorage(Configuration.GetConnectionString("HangfireConnection")));
config.UsePostgreSqlStorage(c =>
c.UseNpgsqlConnection(Configuration.GetConnectionString("HangfireConnection"))));
```

In Configure method, add these two lines:
Expand All @@ -54,16 +55,17 @@ If you encounter any issues/bugs or have idea of a feature regarding Hangfire.Po
SSL support can be enabled for Hangfire.PostgreSql library using the following mechanism:

```csharp
config.UsePostgreSqlStorage(
Configuration.GetConnectionString("HangfireConnection"), // connection string
connection => // connection setup - gets called after instantiating the connection and before any calls to DB are made
{
connection.ProvideClientCertificatesCallback += clientCerts =>
config.UsePostgreSqlStorage(c =>
c.UseNpgsqlConnection(
Configuration.GetConnectionString("HangfireConnection"), // connection string,
connection => // connection setup - gets called after instantiating the connection and before any calls to DB are made
{
clientCerts.Add(X509Certificate.CreateFromCertFile("[CERT_FILENAME]"));
};
},
new PostgreSqlStorageOptions() // no overload without options, so just pass the default or configured options
connection.ProvideClientCertificatesCallback += clientCerts =>
{
clientCerts.Add(X509Certificate.CreateFromCertFile("[CERT_FILENAME]"));
};
}
)
);
```

Expand Down

0 comments on commit ae22240

Please sign in to comment.