-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove aliases, improve tests and add scripts
- Remove connectivity settings alias - Change type of TlsCaFile - Add custom exception - Cleanup tests - Add gencert script for Windows, MacOS and WSL - Add handler in ChannelFactory
- Loading branch information
Showing
8 changed files
with
100 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Write-Host ">> Generating certificate..." | ||
|
||
# Create directory if it doesn't exist | ||
New-Item -ItemType Directory -Path .\certs -Force | ||
|
||
# Set permissions for the directory | ||
icacls .\certs /grant:r "$($env:UserName):(OI)(CI)RX" | ||
|
||
# Pull the Docker image | ||
docker pull eventstore/es-gencert-cli:1.0.2 | ||
|
||
# Create CA certificate | ||
docker run --rm --volume ${PWD}\certs:/tmp --user (Get-Process -Id $PID).SessionId eventstore/es-gencert-cli:1.0.2 create-ca -out /tmp/ca | ||
|
||
# Create node certificate | ||
docker run --rm --volume ${PWD}\certs:/tmp --user (Get-Process -Id $PID).SessionId eventstore/es-gencert-cli:1.0.2 create-node -ca-certificate /tmp/ca/ca.crt -ca-key /tmp/ca/ca.key -out /tmp/node -ip-addresses 127.0.0.1 -dns-names localhost | ||
|
||
# Set permissions recursively for the directory | ||
icacls .\certs /grant:r "$($env:UserName):(OI)(CI)RX" | ||
|
||
Import-Certificate -FilePath ".\certs\ca\ca.crt" -CertStoreLocation Cert:\CurrentUser\Root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/EventStore.Client/Exceptions/ConnectionString/InvalidClientCertificateException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace EventStore.Client { | ||
/// <summary> | ||
/// The exception that is thrown when a certificate is invalid or not found in the EventStoreDB connection string. | ||
/// </summary> | ||
public class InvalidClientCertificateException : ConnectionStringParseException { | ||
/// <summary> | ||
/// Constructs a new <see cref="InvalidClientCertificateException"/>. | ||
/// </summary> | ||
/// <param name="message"></param> | ||
public InvalidClientCertificateException(string message) | ||
: base(message) { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters