Skip to content

403 forbiden error on websocket connection #38

@nesnes

Description

@nesnes

I'm testing the PubSub sample with the websocket configuration because opening the 8883 port isn't possible for my use-case.

Executing the sample, I'm facing a 403 Forbidden in the connection process

HTTP/1.1 403 Forbidden
content-type: application/json
content-length: 118
date: Wed, 13 Sep 2017 14:45:35 GMT
x-amzn-RequestId: XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX //hash replaced by XXX
connection: 

This error is leading to an out_of_range exception. Here is the call stack:
image

My config file looks like the following:

{
  "endpoint": "XXXXXXXXX.iot.XXXXXXX.amazonaws.com",
  "mqtt_port": 8883,
  "https_port": 443,
  "greengrass_discovery_port": 8443,
  "root_ca_relative_path": "certs/rootCA.crt",
  "device_certificate_relative_path": "certs/cert.pem",
  "device_private_key_relative_path": "certs/privkey.pem",
  "tls_handshake_timeout_msecs": 60000,
  "tls_read_timeout_msecs": 2000,
  "tls_write_timeout_msecs": 2000,
  "aws_region": "",
  "aws_access_key_id": "",
  "aws_secret_access_key": "",
  "aws_session_token": "",
  "client_id": "device_test",
  "thing_name": "device_test",
  "is_clean_session": true,
  "mqtt_command_timeout_msecs": 20000,
  "keepalive_interval_secs": 30,
  "minimum_reconnect_interval_secs": 1,
  "maximum_reconnect_interval_secs": 128,
  "maximum_acks_to_wait_for": 32,
  "action_processing_rate_hz": 5,
  "maximum_outgoing_action_queue_length": 32,
  "discover_action_timeout_msecs": 300000
}

And the certs folder is containing the mentioned files.

I didn't changed anything from the source code except solving two compilation issues where std::bind had to be replaced by std::bind<ResponseCode> here and here.

Do you have any idea on how to solve this 403 issue and protect the out_of_range?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions