Код: Выделить всё
wss://.eu-west-1.amazonaws.com:443/mqtt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=/eu-west-1/iotdevicegateway/aws4_request&X-Amz-Date=20250814T085431Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=&X-Amz-Security-Token=и вот мой код
Код: Выделить всё
AwsIotMqttConnectionBuilder builder = AwsIotMqttConnectionBuilder.newMtlsBuilderFromPath(null, null)
.withWebsockets(true) // Crucial for presigned URL connections
.withEndpoint(connectionUrl) // Pass the presigned URL here
.withClientId(clientId)
.withConnectionEventCallbacks(callbacks)
.withWebsocketSigningRegion("eu-west-1")
.withPort(443); // Default WebSocket port
MqttClientConnection connection = builder.build();
// Connect to AWS IoT Core
CompletableFuture connected = connection.connect();
connected.get(); // Wait for connection to complete
< /code>
Я получаю ошибку, когда запускаю код < /p>
java.util.concurrent.ExecutionException: software.amazon.awssdk.crt.mqtt.MqttException: Attempt to sign an http request without credentialsПодробнее здесь: https://stackoverflow.com/questions/797 ... signed-url