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 {
3333 String cloudRegion = "us-central1" ;
3434 int numMessages = 100 ;
3535 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 " ;
3838 String messageType = "event" ;
3939
4040 /** Construct an HttpExampleOptions class from command line flags. */
Original file line number Diff line number Diff line change 2424import java .nio .file .Paths ;
2525import java .security .KeyFactory ;
2626import java .security .spec .PKCS8EncodedKeySpec ;
27+ import java .util .Properties ;
28+
2729import org .eclipse .paho .client .mqttv3 .IMqttDeliveryToken ;
2830import org .eclipse .paho .client .mqttv3 .MqttCallback ;
2931import org .eclipse .paho .client .mqttv3 .MqttClient ;
@@ -158,6 +160,10 @@ public static void main(String[] args) throws Exception {
158160 // connection to your device.
159161 connectOptions .setMqttVersion (MqttConnectOptions .MQTT_VERSION_3_1_1 );
160162
163+ Properties sslProps = new Properties ();
164+ sslProps .setProperty ("com.ibm.ssl.protocol" , "TLSv1.2" );
165+ connectOptions .setSSLProperties (sslProps );
166+
161167 // With Google Cloud IoT Core, the username field is ignored, however it must be set for the
162168 // Paho client library to send the password field. The password field is used to transmit a JWT
163169 // to authorize the device.
You can’t perform that action at this time.
0 commit comments