Skip to content

Commit a1bc17b

Browse files
authored
Update PubSub showing x509 credentials with a proxy (#60)
1 parent 269c2eb commit a1bc17b

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

samples/BasicPubSub/src/main/java/pubsub/PubSub.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,9 @@ public void onConnectionResumed(boolean sessionPresent) {
258258
builder.withWebsockets(true);
259259
builder.withWebsocketSigningRegion(region);
260260

261+
HttpProxyOptions proxyOptions = null;
261262
if (proxyHost != null && proxyPort > 0) {
262-
HttpProxyOptions proxyOptions = new HttpProxyOptions();
263+
proxyOptions = new HttpProxyOptions();
263264
proxyOptions.setHost(proxyHost);
264265
proxyOptions.setPort(proxyPort);
265266

@@ -278,7 +279,8 @@ public void onConnectionResumed(boolean sessionPresent) {
278279
.withTlsContext(x509TlsContext)
279280
.withEndpoint(x509Endpoint)
280281
.withRoleAlias(x509RoleAlias)
281-
.withThingName(x509Thing);
282+
.withThingName(x509Thing)
283+
.withProxyOptions(proxyOptions);
282284
try (X509CredentialsProvider provider = x509builder.build()) {
283285
builder.withWebsocketCredentialsProvider(provider);
284286
}

sdk/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<dependency>
4242
<groupId>software.amazon.awssdk.crt</groupId>
4343
<artifactId>aws-crt</artifactId>
44-
<version>0.5.6</version>
44+
<version>0.5.7</version>
4545
<scope>compile</scope>
4646
</dependency>
4747
<dependency>

0 commit comments

Comments
 (0)