Skip to content

Commit 37442d2

Browse files
committed
Use the same url for username/password and mTLS connection
1 parent 8a1ab60 commit 37442d2

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/ArduinoIoTCloudTCP.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,10 @@ ArduinoIoTCloudTCP::ArduinoIoTCloudTCP()
114114
int ArduinoIoTCloudTCP::begin(ConnectionHandler & connection, bool const enable_watchdog, String brokerAddress, uint16_t brokerPort)
115115
{
116116
_connection = &connection;
117+
_brokerAddress = brokerAddress;
117118
#ifdef BOARD_HAS_SECRET_KEY
118-
_brokerAddress = _password.length() ? DEFAULT_BROKER_ADDRESS_USER_PASS_AUTH : brokerAddress;
119119
_brokerPort = _password.length() ? DEFAULT_BROKER_PORT_USER_PASS_AUTH : brokerPort;
120120
#else
121-
_brokerAddress = brokerAddress;
122121
_brokerPort = brokerPort;
123122
#endif
124123
_time_service.begin(&connection);

src/ArduinoIoTCloudTCP.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,9 @@
5353
/******************************************************************************
5454
CONSTANTS
5555
******************************************************************************/
56-
#if defined(BOARD_HAS_SECURE_ELEMENT)
57-
static char const DEFAULT_BROKER_ADDRESS_SECURE_AUTH[] = "mqtts-sa.iot.arduino.cc";
56+
static char const DEFAULT_BROKER_ADDRESS_SECURE_AUTH[] = "iot.arduino.cc";
5857
static uint16_t const DEFAULT_BROKER_PORT_SECURE_AUTH = 8883;
59-
#endif
60-
61-
#if defined(BOARD_HAS_SECRET_KEY)
62-
static char const DEFAULT_BROKER_ADDRESS_USER_PASS_AUTH[] = "mqtts-up.iot.arduino.cc";
6358
static uint16_t const DEFAULT_BROKER_PORT_USER_PASS_AUTH = 8884;
64-
#endif
6559

6660
/******************************************************************************
6761
* TYPEDEF
@@ -151,7 +145,7 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
151145
#if defined(BOARD_HAS_SECURE_ELEMENT)
152146
SecureElement _crypto;
153147
#if !defined(BOARD_HAS_OFFLOADED_ECCX08)
154-
ECP256Certificate _cert;
148+
ECP256Certificate _cert;
155149
#endif
156150
#endif
157151

0 commit comments

Comments
 (0)