Skip to content

Debug help please - ERROR: main L#190 Error(-12)

0

Hello Folks,

I seem to be having a problem connecting my client to the IOT server. My IOT console is showing that I'm making connection, however I'm receiving the following error on the client debug output:
ERROR: main L#190 Error(-12) connecting to a12j6rskk6eu7d-ats.iot.us-east-1.amazonaws.com:8883

I'm new to AWS IOT, and have not yet had my system up and running, so my thought is that I don't have something configured properly.

My full client log as well as my configuration is listed below. I'm using the C++ version of the code.

Thanks in advance for your help, and please let me know if you need any other further information to assist with the debug.

-Shawn

CLIENT OUTPUT:

root@PCD-FDE2:~/aws_sdk/sample_apps# ./subscribe_publish_sample

AWS IoT SDK Version 3.0.1-

DEBUG: main L#159 rootCA /root/aws_sdk/sample_apps/../certs/rootCA.crt
DEBUG: main L#160 clientCRT /root/aws_sdk/sample_apps/../certs/cert1.crt
DEBUG: main L#161 clientKey /root/aws_sdk/sample_apps/../certs/private1.key
Connecting...
DEBUG: iot_tls_connect L#132
. Seeding the random number generator...
DEBUG: iot_tls_connect L#140 . Loading the CA root certificate ...
DEBUG: iot_tls_connect L#146 ok (0 skipped)

DEBUG: iot_tls_connect L#148 . Loading the client cert. and key...
DEBUG: iot_tls_connect L#161 ok

DEBUG: iot_tls_connect L#163 . Connecting to a12j6rskk6eu7d-ats.iot.us-east-1.amazonaws.com/8883...
DEBUG: iot_tls_connect L#182 ok

DEBUG: iot_tls_connect L#184 . Setting up the SSL/TLS structure...
DEBUG: iot_tls_connect L#225

SSL state connect : 0
DEBUG: iot_tls_connect L#228 ok

DEBUG: iot_tls_connect L#230

SSL state connect : 0
DEBUG: iot_tls_connect L#231 . Performing the SSL/TLS handshake...
DEBUG: _iot_tls_verify_cert L#51
Verify requested for (Depth 2):

DEBUG: _iot_tls_verify_cert L#53 cert. version : 3
serial number : 06:7F:94:4A:2A:27:CD:F3:FA:C2:AE:2B:01:F9:08:EE:B9:C4:C6
issuer name : C=US, ST=Arizona, L=Scottsdale, O=Starfield Technologies, Inc., CN=Starfield Services Root Certificate Authority - G2
subject name : C=US, O=Amazon, CN=Amazon Root CA 1
issued on : 2015-05-25 12:00:00
expires on : 2037-12-31 01:00:00
signed using : RSA with SHA-256
RSA key size : 2048 bits
basic constraints : CA=true
key usage : Digital Signature, Key Cert Sign, CRL Sign
certificate policies : Any Policy

DEBUG: _iot_tls_verify_cert L#56 This certificate has no flags

DEBUG: _iot_tls_verify_cert L#51
Verify requested for (Depth 1):

DEBUG: _iot_tls_verify_cert L#53 cert. version : 3
serial number : 06:7F:94:57:85:87:E8:AC:77:DE:B2:53:32:5B:BC:99:8B:56:0D
issuer name : C=US, O=Amazon, CN=Amazon Root CA 1
subject name : C=US, O=Amazon, OU=Server CA 1B, CN=Amazon
issued on : 2015-10-22 00:00:00
expires on : 2025-10-19 00:00:00
signed using : RSA with SHA-256
RSA key size : 2048 bits
basic constraints : CA=true, max_pathlen=0
key usage : Digital Signature, Key Cert Sign, CRL Sign
certificate policies : ???

DEBUG: _iot_tls_verify_cert L#56 This certificate has no flags

DEBUG: _iot_tls_verify_cert L#51
Verify requested for (Depth 0):

DEBUG: _iot_tls_verify_cert L#53 cert. version : 3
serial number : 0F:B5:CF:2F:A1:69:48:A1:35:BB:4A:A8:5E:97:C0:AB
issuer name : C=US, O=Amazon, OU=Server CA 1B, CN=Amazon
subject name : CN=*.iot.us-east-1.amazonaws.com
issued on : 2020-04-03 00:00:00
expires on : 2021-04-03 12:00:00
signed using : RSA with SHA-256
RSA key size : 2048 bits
basic constraints : CA=false
subject alt name :
dNSName : iot.us-east-1.amazonaws.com
dNSName : *.iot.us-east-1.amazonaws.com
key usage : Digital Signature, Key Encipherment
ext key usage : TLS Web Server Authentication, TLS Web Client Authentication
certificate policies : ???, ???

DEBUG: _iot_tls_verify_cert L#56 This certificate has no flags

DEBUG: iot_tls_connect L#248 ok
[ Protocol is TLSv1.2 ]
[ Ciphersuite is TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 ]

DEBUG: iot_tls_connect L#250 [ Record expansion is 29 ]

DEBUG: iot_tls_connect L#255 . Verifying peer X.509 certificate...
DEBUG: iot_tls_connect L#264 ok

DEBUG: iot_tls_connect L#274 . Peer certificate information ...

DEBUG: iot_tls_connect L#276 cert. version : 3
serial number : 0F:B5:CF:2F:A1:69:48:A1:35:BB:4A:A8:5E:97:C0:AB
issuer name : C=US, O=Amazon, OU=Server CA 1B, CN=Amazon
subject name : CN=*.iot.us-east-1.amazonaws.com
issued on : 2020-04-03 00:00:00
expires on : 2021-04-03 12:00:00
signed using : RSA with SHA-256
RSA key size : 2048 bits
basic constraints : CA=false
subject alt name :
dNSName : iot.us-east-1.amazonaws.com
dNSName : *.iot.us-east-1.amazonaws.com
key usage : Digital Signature, Key Encipherment
ext key usage : TLS Web Server Authentication, TLS Web Client Authentication
certificate policies : ???, ???

ERROR: main L#190 Error(-12) connecting to a12j6rskk6eu7d-ats.iot.us-east-1.amazonaws.com:8883
root@PCD-FDE2:~/aws_sdk/sample_apps#

CLIENT CONFIG:

// =================================================
#define AWS_IOT_MQTT_HOST "a12j6rskk6eu7d-ats.iot.us-east-1.amazonaws.com" ///< Customer specific MQTT HOST. The same will be used for Thing Shadow
#define AWS_IOT_MQTT_PORT 8883 ///< default port for MQTT/S
#define AWS_IOT_MQTT_CLIENT_ID "arn:aws:iot:us-east-1:901916029934:thing/pcd2" ///< MQTT client ID should be unique for every device
#define AWS_IOT_MY_THING_NAME "arn:aws:iot:us-east-1:901916029934:thing/pcd2" ///< Thing Name of the Shadow this device is associated with
#define AWS_IOT_ROOT_CA_FILENAME "rootCA.crt" ///< Root CA file name
#define AWS_IOT_CERTIFICATE_FILENAME "cert1.crt" ///< device signed certificate file name
#define AWS_IOT_PRIVATE_KEY_FILENAME "private1.key" ///< Device private key filename
// =================================================

asked 6 years ago476 views

1 Answer
0

I figured it out. I didn't have my policy set up correctly on the server side.

answered 6 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.