File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
iot/api-client/manager/src/main/java/com/example/cloud/iot/examples Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ public class HttpExampleOptions {
33
33
String cloudRegion = "us-central1" ;
34
34
int numMessages = 100 ;
35
35
int tokenExpMins = 20 ;
36
- String httpBridgeAddress = "https://cloudiot-device .googleapis.com" ;
37
- String apiVersion = "v1beta1 " ;
36
+ String httpBridgeAddress = "https://cloudiotdevice .googleapis.com" ;
37
+ String apiVersion = "v1 " ;
38
38
String messageType = "event" ;
39
39
40
40
/** Construct an HttpExampleOptions class from command line flags. */
Original file line number Diff line number Diff line change 24
24
import java .nio .file .Paths ;
25
25
import java .security .KeyFactory ;
26
26
import java .security .spec .PKCS8EncodedKeySpec ;
27
+ import java .util .Properties ;
28
+
27
29
import org .eclipse .paho .client .mqttv3 .IMqttDeliveryToken ;
28
30
import org .eclipse .paho .client .mqttv3 .MqttCallback ;
29
31
import org .eclipse .paho .client .mqttv3 .MqttClient ;
@@ -158,6 +160,10 @@ public static void main(String[] args) throws Exception {
158
160
// connection to your device.
159
161
connectOptions .setMqttVersion (MqttConnectOptions .MQTT_VERSION_3_1_1 );
160
162
163
+ Properties sslProps = new Properties ();
164
+ sslProps .setProperty ("com.ibm.ssl.protocol" , "TLSv1.2" );
165
+ connectOptions .setSSLProperties (sslProps );
166
+
161
167
// With Google Cloud IoT Core, the username field is ignored, however it must be set for the
162
168
// Paho client library to send the password field. The password field is used to transmit a JWT
163
169
// to authorize the device.
You can’t perform that action at this time.
0 commit comments