Skip to content

Commit ca01998

Browse files
committed
Sync documentation of main branch
1 parent 3987bdb commit ca01998

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

_versions/main/guides/websockets-next-reference.adoc

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,16 +1465,41 @@ class MyBean {
14651465

14661466
=== Configuring SSL/TLS
14671467

1468-
To establish a TLS connection, you need to configure a _named_ configuration using the xref:./tls-registry-reference.adoc[TLS registry]:
1468+
To establish a TLS connection, you need to configure a _named_ configuration using the xref:./tls-registry-reference.adoc[TLS registry]. This is typically done via configuration:
14691469

14701470
[source, properties]
14711471
----
14721472
quarkus.tls.my-ws-client.trust-store.p12.path=server-truststore.p12
14731473
quarkus.tls.my-ws-client.trust-store.p12.password=secret
1474+
----
1475+
1476+
With a _named_ TLS configuration established, you can then configure the client to use it:
1477+
1478+
[source, properties]
1479+
----
1480+
quarkus.websockets-next.client.tls-configuration-name=my-ws-client
1481+
----
1482+
1483+
Alternatively, you can supply the configuration name using the <<client-connectors,connector>>:
1484+
1485+
[source, java]
1486+
----
1487+
@Singleton
1488+
public class MyBean {
1489+
1490+
@Inject
1491+
WebSocketConnector<MyEndpoint> connector;
14741492
1475-
quarkus.websockets-next.client.tls-configuration-name=my-ws-client # Reference the named configuration
1493+
public void connect() {
1494+
connector
1495+
.tlsConfigurationName("my-ws-client")
1496+
.connectAndAwait();
1497+
}
1498+
}
14761499
----
14771500

1501+
A name supplied to the connector will override any statically configured name. This can be useful for establishing a default configuration which can be overridden at runtime as necessary.
1502+
14781503
WARNING: When using the WebSocket client, using a _named_ configuration is required to avoid conflicts with other TLS configurations.
14791504
The client will not use the default TLS configuration.
14801505

0 commit comments

Comments
 (0)