Skip to content

Commit 302ff5a

Browse files
authored
Manually update certutil links
1 parent cd82223 commit 302ff5a

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

docs/client-concepts/certificates/working-with-certificates.asciidoc

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ that generated the certificate is trusted by the machine running the client code
2121
to the cluster over HTTPS with the client.
2222

2323
If you are using your own CA which is not trusted however, .NET won't allow you to make HTTPS calls to that endpoint by default. With .NET,
24-
you can pre-empt this though a custom validation callback on the global static`ServicePointManager.ServerCertificateValidationCallback`. Most examples you will find doing this this will simply return `true` from the
24+
you can pre-empt this though a custom validation callback on the global static
25+
`ServicePointManager.ServerCertificateValidationCallback`. Most examples you will find doing this this will simply return `true` from the
2526
validation callback and merrily whistle off into the sunset. **This is not advisable** as it allows *any* HTTPS traffic through in the
2627
current `AppDomain` *without* any validation. Here's a concrete example:
2728

@@ -40,7 +41,8 @@ validation will not be performed for HTTPS connections to *both* Elasticsearch *
4041

4142
It's possible to also set a callback per service endpoint with .NET, and both Elasticsearch.NET and NEST expose this through
4243
connection settings `ConnectionConfiguration` with Elasticsearch.Net and `ConnectionSettings` with NEST). You can do
43-
your own validation in that handler or use one of the baked in handlers that we ship with out of the box, on the static class`CertificateValidations`.
44+
your own validation in that handler or use one of the baked in handlers that we ship with out of the box, on the static class
45+
`CertificateValidations`.
4446

4547
The two most basic ones are `AllowAll` and `DenyAll`, which accept or deny all SSL traffic to our nodes, respectively. Here's
4648
a couple of examples.
@@ -55,7 +57,7 @@ public class DenyAllCertificatesCluster : SslAndKpiXPackCluster
5557
{
5658
protected override ConnectionSettings ConnectionSettings(ConnectionSettings s) => s
5759
.ServerCertificateValidationCallback((o, certificate, chain, errors) => false)
58-
.ServerCertificateValidationCallback(CertificateValidations.DenyAll); <1>
60+
.ServerCertificateValidationCallback(CertificateValidations.DenyAll); <1>
5961
}
6062
----
6163
<1> synonymous with the previous lambda expression
@@ -70,7 +72,7 @@ public class AllowAllCertificatesCluster : SslAndKpiXPackCluster
7072
{
7173
protected override ConnectionSettings ConnectionSettings(ConnectionSettings s) => s
7274
.ServerCertificateValidationCallback((o, certificate, chain, errors) => true)
73-
.ServerCertificateValidationCallback(CertificateValidations.AllowAll); <1>
75+
.ServerCertificateValidationCallback(CertificateValidations.AllowAll); <1>
7476
}
7577
----
7678
<1> synonymous with the previous lambda expression
@@ -80,8 +82,9 @@ public class AllowAllCertificatesCluster : SslAndKpiXPackCluster
8082
If your client application has access to the public CA certificate locally, Elasticsearch.NET and NEST ship with some handy helpers
8183
that can assert that a certificate the server presents is one that came from the local CA.
8284

83-
If you use X-Pack's {ref_current}/certutil.html`certutil` tool] to generate SSL certificates, the generated node certificate
84-
does not include the CA in the certificate chain, in order to cut down on SSL handshake size. In those case you can use`CertificateValidations.AuthorityIsRoot` and pass it your local copy of the CA public key to assert that
85+
If you use X-Pack's {ref_current}/certutil.html[+certutil+ tool] to generate SSL certificates, the generated node certificate
86+
does not include the CA in the certificate chain, in order to cut down on SSL handshake size. In those case you can use
87+
`CertificateValidations.AuthorityIsRoot` and pass it your local copy of the CA public key to assert that
8588
the certificate the server presented was generated using it
8689

8790
[source,csharp]
@@ -115,7 +118,7 @@ the local CA certificate is part of the chain that was used to generate the serv
115118
==== Client Certificates
116119

117120
X-Pack also allows you to configure a {xpack_current}/pki-realm.html[PKI realm] to enable user authentication
118-
through client certificates. The {ref_current}/certutil.html`certutil` tool] included with X-Pack allows you to
121+
through client certificates. The {ref_current}/certutil.html[+certutil+ tool] included with X-Pack allows you to
119122
generate client certificates as well and assign the distinguished name (DN) of the
120123
certificate to a user with a certain role.
121124

@@ -133,12 +136,12 @@ You can set Client Certificates to use on all connections on `ConnectionSettings
133136
----
134137
public class PkiCluster : CertgenCaCluster
135138
{
136-
protected override ConnectionSettings Authenticate(ConnectionSettings s) => s <1>
139+
protected override ConnectionSettings Authenticate(ConnectionSettings s) => s <1>
137140
.ClientCertificate(
138141
ClientCertificate.LoadWithPrivateKey(
139-
this.Node.FileSystem.ClientCertificate, <2>
140-
this.Node.FileSystem.ClientPrivateKey, <3>
141-
"") <4>
142+
this.Node.FileSystem.ClientCertificate, <2>
143+
this.Node.FileSystem.ClientPrivateKey, <3>
144+
"") <4>
142145
);
143146
144147
//hide

0 commit comments

Comments
 (0)