Skip to content

Commit f5ea747

Browse files
committed
Use the same url for username/password and mTLS connection
1 parent 81a1ef0 commit f5ea747

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/ArduinoIoTCloudTCP.cpp

+1-2
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

+1-7
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

0 commit comments

Comments
 (0)