I'm trying to connect to AWS IoT Core using MQTT, WebSocket and HTTPS communication protocols.
Here I'm using Node-Red as an IoT Device simulator. While doing this I'm able to successfully connect using both MQTT and HTTPS protocol but WebSocket connection is not working.
MQTT EndPoint: xxxx..amazonaws.com:8883
HTTPS EndPoint: https://xxxx..amazonaws.com:8443/topics/iot%2Ftelemetry?qos=1
WebSocket EndPoint: wss://xxxx..amazonaws.com:443/mqtt
Error in Node-Red Console when I try to publish a message to AWS IoT Core using WebSocket protocol
"An error occurred while sending: Error: WebSocket is not open: readyState 3 (CLOSED)"
The above error clearly states that Node-Red is not able to establish the WebSocket connection due to incorrect configuration.
Can anyone who has connected to AWS IoT Core using WebSocket protocol share some pointers here?
Related
In MSK to communicate with brokers by using TLS(SSL) we have used 9094 port and able to communicate MSK cluster with the required keystore and truststore configurations.
And to communicate with brokers by using SASL_SCRAM we have used 9096 port and able to communicate MSK cluster with username and password configurations.
And now we want to configure both SASL_SSL to authenticate client while connecting to broker nodes as a mandatory configurations at client side.
NOTE: We are able to configure both SASL_SSL security protocol on 9096 port but the client configuration considered as the TLS configurations are optional because if we remove TLS properties, still it is able to connect broker nodes.
Im testing this connection with kafka console producer like below:
./bin/kafka-console-producer.sh --broker-list b-1.xxx:9096,b-2xx:9096 --producer.config ./bin/client_sasl_ssl.properties --topic TestTopicSASLSSL
File: client_sasl_ssl.properties
security.protocol=SASL_SSL
sasl.mechanism=SCRAM-SHA-512
#ssl.truststore.location=/path/to/kafka.client.truststore.jks
#ssl.keystore.location=/path/to/kafka.client.keystore.jks
#ssl.keystore.password=psswd
#ssl.key.password=psswd
Please note that im able to produce data with or without the above commented ssl properties, which seems optional.
Any option to mandate both SASL and TLS auth protocol to restrict client connection.
HTTP Request node connecting to a third party REST API, which is hosted on AWS intermittently throwing "A timeout error occurred whilst performing an SSL socket operation ". I would like to know why is it happening intermittently and how to find root cause of this issue. While we invoking services in OnPrem instead of AWS all good , when we swith to AWS he are facing the following issue
HTTP Request Node Settings: Protocol - TLSv1.2 ,HTTP Version 1.1
IBM Integration Bus v10.0.0.8 and IBM ACE 12.01
POST //url**** HTTP/1.1 ;A Web Service request has detected a SOCKET error whilst invoking a web service located at host ****t;A timeout error occurred whilst performing an SSL socket operation
BIPmsgs Number :3166
I'm working with a MINIO server and AWS cpp SDK client.
Everything works with HTTP, but after switching to HTTPS I'm getting "NETWORK CONNECTION" errors.
In Wireshark the connection is:
client Hello
server hello
server sends Certificate , Server key exchange, Certificate Request, Server Hello Done
client sends ack
client sends FIN, ACK
When activating debug, aws logs the following error: WinHttpSyncHttpClient [54364] Send request failed: A certificate is required to complete client authentication
What works:
AWS CLI to the MINIO (works with TLS 1.3 so the connection looks different)
The same SDK with no SSL connection (when turning if off in MINIO as well).
The same SDK works well with AWS S3 (with SSL).
What was tried and does not work:
Turning "verifySSL" on and off
Sending and not sending region
Manually switching to HTTP 1.1
Does anyone have ideas on how to identify\solve the problem?
We managed to bypass the problem by switching to OpenSSL instead of WinHttpSyncHttpClient, by turning the relevant flag in AWS SDK CMake file.
I am running Mosquitto Broker on AWS Ubuntu 20.04.2 LTS server. I have 2 MQTT bridges, from my laptop to the broker on the server and from the server to AWS IoT.
My broker configuration on the server is as follows:
listener 1883
protocol mqtt
listener 9001
protocol websockets
allow_anonymous false
password_file /etc/mosquitto/conf.d/passwd.txt
connection awsiot
address xxxxxxxxxx-ats.iot.eu-north-1.amazonaws.com:8883
topic iotethernet/switch/count out 1
topic iotethernet/ledblock/states in 1
bridge_protocol_version mqttv311
bridge_insecure false
bridge_outgoing_retain false
cleansession true
clientid bridgeawsiot
start_type automatic
notifications true
log_type all
bridge_cafile /etc/mosquitto/certs/rootCA.pem
bridge_certfile /etc/mosquitto/certs/cert.crt
bridge_keyfile /etc/mosquitto/certs/private.key
The problem is that when I am running the server, the bridge client constantly connects and immediately disconnects without an error message.
I have made sure that the bridge doesn't work by testing with the AWS IoT -test feature.
The bridge from laptop to server works fine.
i got it working by setting notifications to false
I've been following the AWS IoT docs trying to get started with the MQTT tutorial at
http://docs.aws.amazon.com/iot/latest/developerguide/protocols.html#mqtt-ws
to set up a WebSocket connection to AWS IoT in a web application. The first step is to initiate a WebSocket connection by making a GET request to an endpoint created by following the steps in the tutorial but I'm getting this error:
XMLHttpRequest cannot load <my endpoint> Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
I was wondering if anyone has encountered this error and if so, how they resolved it?
Here's a link to the code https://github.com/dwyl/learn-aws-iot/blob/2c8035728ec8228e296580c8714f3f7ace870fbe/src/js/components/App.js
Here's an example of how I'm opening the channel. I'm using Cognito unauth roles as a subscriber. I'm using the JS Paho client as well.
http://draw.kyleroche.com/main.js
AWS Labs has also posted an MQTT over WebSockets reference example here: https://github.com/awslabs/aws-iot-examples