|
| 1 | +/* |
| 2 | + * AWS IoT Device SDK for Embedded C 202108.00 |
| 3 | + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * |
| 5 | + * Permission is hereby granted, free of charge, to any person obtaining a copy of |
| 6 | + * this software and associated documentation files (the "Software"), to deal in |
| 7 | + * the Software without restriction, including without limitation the rights to |
| 8 | + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
| 9 | + * the Software, and to permit persons to whom the Software is furnished to do so, |
| 10 | + * subject to the following conditions: |
| 11 | + * |
| 12 | + * The above copyright notice and this permission notice shall be included in all |
| 13 | + * copies or substantial portions of the Software. |
| 14 | + * |
| 15 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| 17 | + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| 18 | + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| 19 | + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 20 | + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 21 | + */ |
| 22 | + |
| 23 | +#ifndef AWS_IOT_ALPN_DEFS_H_ |
| 24 | +#define AWS_IOT_ALPN_DEFS_H_ |
| 25 | + |
| 26 | +/* |
| 27 | + * AWS IoT Core allows the use of HTTP or MQTT over TCP port 443. Connections |
| 28 | + * to IoT Core endpoints on port 443 default to the HTTP protocol. |
| 29 | + * |
| 30 | + * Clients must use the TLS Application-Layer Protocol Negotiation extension |
| 31 | + * to notify the service of it's desired protocol or authentication mode. |
| 32 | + * |
| 33 | + * For more information, please reference the following URL: |
| 34 | + * https://docs.aws.amazon.com/iot/latest/developerguide/protocols.html |
| 35 | + */ |
| 36 | + |
| 37 | +#define AWS_IOT_ALPN_MQTT_CUSTOM_AUTH "mqtt" |
| 38 | +#define AWS_IOT_ALPN_MQTT_CA_AUTH "x-amzn-mqtt-ca" |
| 39 | +#define AWS_IOT_ALPN_HTTP_CA_AUTH "x-amzn-http-ca" |
| 40 | + |
| 41 | +/* |
| 42 | + * @note OpenSSL requires that ALPN identifiers be provided in protocol form. |
| 43 | + * This means that each alpn string be prepended with its length. |
| 44 | + * When multiple concurrent alpn identifiers are necessary, |
| 45 | + * each identifier should be prepended with it's respective length and |
| 46 | + * then concatenated together. |
| 47 | + */ |
| 48 | +#define AWS_IOT_ALPN_MQTT_CUSTOM_AUTH_OPENSSL "\x04mqtt" |
| 49 | +#define AWS_IOT_ALPN_MQTT_CUSTOM_AUTH_OPENSSL_LEN ( sizeof( AWS_IOT_ALPN_MQTT_CUSTOM_AUTH_OPENSSL ) - 1U ) |
| 50 | + |
| 51 | +#define AWS_IOT_ALPN_MQTT_CA_AUTH_OPENSSL "\x0ex-amzn-mqtt-ca" |
| 52 | +#define AWS_IOT_ALPN_MQTT_CA_AUTH_OPENSSL_LEN ( sizeof( AWS_IOT_ALPN_MQTT_CA_AUTH_OPENSSL ) - 1U ) |
| 53 | + |
| 54 | +#define AWS_IOT_ALPN_HTTP_CA_AUTH_OPENSSL "\x0ex-amzn-http-ca" |
| 55 | +#define AWS_IOT_ALPN_HTTP_CA_AUTH_OPENSSL_LEN ( sizeof( AWS_IOT_ALPN_HTTP_CA_AUTH_OPENSSL ) - 1U ) |
| 56 | + |
| 57 | +/* |
| 58 | + * @note MbedTLS requires alpn identifiers to be provided in a null terminated |
| 59 | + * array of null terminated c strings. |
| 60 | + */ |
| 61 | +#define AWS_IOT_ALPN_MQTT_CUSTOM_AUTH_MBEDTLS { AWS_IOT_ALPN_MQTT_CUSTOM_AUTH, NULL } |
| 62 | +#define AWS_IOT_ALPN_MQTT_CA_AUTH_MBEDTLS { AWS_IOT_ALPN_MQTT_CA_AUTH, NULL } |
| 63 | +#define AWS_IOT_ALPN_HTTP_CA_AUTH_MBEDTLS { AWS_IOT_ALPN_HTTP_CA_AUTH, NULL } |
| 64 | + |
| 65 | +#endif /* AWS_IOT_ALPN_DEFS_H_ */ |
0 commit comments