iCloud SSL issue again

What is the error you get when you try to install?
I think nothing changed which will prevent that you can’t use this version on 2.4… maybe some dependency are not met on 2.4 but that can be installed manually then…

Here is the error message:

2020-01-24 12:53:52.396 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.icloud-2.5.2-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.icloud [237]
  Unresolved requirement: Import-Package: com.google.gson; version="[2.8.0,3.0.0)"
	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [10:org.apache.felix.fileinstall:3.6.4]

Use the console to install this dependency:

bundle:install http://central.maven.org/maven2/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar 

Then you can install the jar without problems…

FIXED: https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar

NOW it works.
no reboot, only JAR in addons folder.

THX @rkrisi

THX @rkrisi, iCloud binding is back online :metal:

UPDATE: After one day…the error is back :roll_eyes:

[WARN ] [ernal.handler.ICloudAccountBridgeHandler] - Unable to refresh device data

I followed all the steps, Karaf shows the installed binding
257 │ Active │ 80 │ 2.5.2.202001211144 │ openHAB Add-ons :: Bundles :: iCloud Binding
but I continue to see Unable to refresh device data java.io.IOException: java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem in the logs. Have restarted the bundle.
How do I troubleshoot from here?

Same issue here:
278 │ Active │ 80 │ 2.5.2.202001211144 │ org.openhab.binding.icloud

2020-01-27 19:14:31.279 [WARN ] [l.handler.ICloudAccountBridgeHandler] - Unable to refresh device data
at org.openhab.binding.icloud.internal.ICloudConnection.callApi(ICloudConnection.java:91) ~[?:?]
at org.openhab.binding.icloud.internal.ICloudConnection.requestDeviceStatusJSON(ICloudConnection.java:72) ~[?:?]
at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.lambda$0(ICloudAccountBridgeHandler.java:95) ~[?:?]
at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.refreshData(ICloudAccountBridgeHandler.java:152) ~[?:?]

Did you used my local build available as a GDrive link?

This is not related to the SSL error. Sometimes the iCloud API won’t respond, that’s why you get this… when the next update cycle will happen, it will connect normally I think…

Hello,
this morning again a certificate issue
i did a script but i didn’t test it (because i added the new certificate through windows and things started going again)
but this problem has become frequent and I will be wise to do it alone. So far, I have assembled it.

root@orangepiplus:/etc/openhab2/scripts/icloud# ls
2.5.1  org.openhab.binding.icloud-2.5.1.jar  updateicloudcrt.sh
root@orangepiplus:/etc/openhab2/scripts/icloud# ./updateicloudcrt.sh
0
3894
1074
3894
1074
adding: fmipmobile.crt(in = 3894) (out= 1194)(deflated 69%)
root@orangepiplus:/etc/openhab2/scripts/icloud# cat updateicloudcrt.sh
#!/bin/bash
openssl s_client -servername fmipmobile.icloud.com -host fmipmobile.icloud.com -port 443 -prexit -showcerts <<< "Q" 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > icloud2.crt
csplit -f cert icloud2.crt '/^-----BEGIN CERTIFICATE-----/' {*}
rm -f cert00 cert02 cert03 cert04 icloud2.crt
mv cert01 fmipmobile.crt
chown openhab:openhab fmipmobile.crt
jar -uvf org.openhab.binding.icloud-2.5.1.jar fmipmobile.crt
rm -f fmipmobile.crt

# /var/lib/openhab2/tmp/kar/openhab-addons-2.5.1/org/openhab/addons/bundles/org.openhab.binding.icloud/2.5.1
#
#root@orangepiplus:/etc/openhab2/scripts/icloud# cd ..
root@orangepiplus:/etc/openhab2/scripts# ls
icloud  icloudrestart-disable.sh  icloudrestart-enable.sh  readme.txt  uptime.sh
root@orangepiplus:/etc/openhab2/scripts# cat icloudrestart-disable.sh
#!/bin/bash

sshpass -p 'habopen' ssh -p 8101 openhab@localhost 'things disable icloud:account:afb3291d'root@orangepiplus:/etc/openhab2/scripts#
root@orangepiplus:/etc/openhab2/scripts# cat icloudrestart-enable.sh
#!/bin/bash

sshpass -p 'habopen' ssh -p 8101 openhab@localhost 'things enable icloud:account:afb3291d'
root@orangepiplus:/etc/openhab2/scripts#

i have rule from restart icloud

var Timer iphoneTimer10 = null
var Timer iphoneTimer60 = null
var Number checked = 0

rule "iPhone Home"
when
    Item iPhone_Location changed
then
    // specify your home location
    val PointType home_location  = new PointType(new DecimalType(43.4033834), new DecimalType(24.6145293))
    val PointType phone_location = iPhone_Location.state as PointType
    val int distance = phone_location.distanceFrom(home_location).intValue()
    // specify your preferred radius (in meters)
    if ( distance < 1000) {
        iPhone_Home.postUpdate(ON)
        //logInfo("iPhone Home", "iPhone is at home.")
    } else {
        iPhone_Home.postUpdate(OFF)
        //logInfo("iPhone Home", "iPhone is away.")
    }
end

rule "iPhone Coordinates Accuracy"
when
    Item E16557506temp0 received update
then
    val accuracy = iPhone_LocationAccuracy.state as Number
    if (accuracy > 1000 && checked == 0 ){
    checked = 1
    sendBroadcastNotification("ALERT: iPhone location accuracy abnormal!")
    //logInfo("rule", "location accuracy abnormal")
    }
    if (accuracy < 1000 && checked == 1 ){
    checked = 0
    //logInfo("rule", "location accuracy normal")
    }
end

rule "iPhone update lost"
when
    Item iPhone_LocationLastUpdate changed
then
    if(iphoneTimer10 !==null) { iphoneTimer10.cancel() iphoneTimer10 = null }
    //logInfo("rule", "stop timer")

    if(iphoneTimer10 === null ) {
        //logInfo("rule", "start timer")
        iphoneTimer10 = createTimer(now.plusMinutes(10), [|
        iphoneTimer10 = null
        val output0 = executeCommandLine("bash /etc/openhab2/scripts/icloudrestart-disable.sh", 10000)
        logInfo("rules", "iphone" + output0)
        val output1 = executeCommandLine("bash /etc/openhab2/scripts/icloudrestart-enable.sh", 10000)
        logInfo("rules", "iphone" + output1)
        //sendBroadcastNotification("ALERT: iPhone update stop update more then 15 minutes!")
        //logInfo("rule", "run timer")
    ])
    }

    if(iphoneTimer60 !==null) { iphoneTimer60.cancel() iphoneTimer60 = null }
    //logInfo("rule", "stop timer")

    if(iphoneTimer60 === null ) {
        //logInfo("rule", "start timer")
        iphoneTimer60 = createTimer(now.plusMinutes(60), [|
        iphoneTimer60 = null
        sendBroadcastNotification("ALERT: iPhone update stop update more then 60 minutes!")
        //logInfo("rule", "run timer")
    ])
    }

end

1 Like

Hi, i used the one fron gdrive…getting now this again.

421 [WARN ] [ernal.handler.ICloudAccountBridgeHandler] - Unable to refresh device data

java.io.IOException: java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem

Active │ 80 │ 2.5.2.202001211144 │ openHAB Add-ons :: Bundles :: iCloud Binding

You are right I see it now also.
So it seems the certificate changed again… I hoped it will work for at least a few weeks.
We are already working on a solution to pull the cert automatically, but we need some time. (@Hawkeye)

I will try to provide a new cert… However it means a new built jar…

3 Likes

I’m fairly certain we can make this issue go away for a long time, but it takes a bit of coding due to some constructs in the code. I’ll try to make it work as soon as I can

2 Likes

Thanks so much.
I really appreciated your lightning fast support! :slight_smile:

I did. Since my Karaf is showing the right release number there is no way I could have messed up that step right?

Actually my iCloud somehow came back online.
Let’s see for how long

EDIT:
Too early happy.
It was a mismatch on displaying the iCloud state. :frowning:

I will try to provide a new jar today as a temporary fix until we finish the code.

test and work

cp /var/lib/openhab2/tmp/kar/openhab-addons-2.5.1/org/openhab/addons/bundles/org.openhab.binding.icloud/2.5.1/org.openhab.binding.icloud-2.5.1.jar .

openssl s_client -servername fmipmobile.icloud.com -host fmipmobile.icloud.com -port 443 -prexit -showcerts <<< "Q" 2>/dev/null | sed -ne '/-BEGIN CERT
csplit -f cert icloud2.crt '/^-----BEGIN CERTIFICATE-----/' {*}
rm -f cert00 cert02 cert03 cert04 icloud2.crt
mv cert01 fmipmobile.crt
chown openhab:openhab fmipmobile.crt
jar -uvf org.openhab.binding.icloud-2.5.1.jar fmipmobile.crt
rm -f fmipmobile.crt
chown openhab:openhab org.openhab.binding.icloud-2.5.1.jar
mv org.openhab.binding.icloud-2.5.1.jar /var/lib/openhab2/tmp/kar/openhab-addons-2.5.1/org/openhab/addons/bundles/org.openhab.binding.icloud/2.5.1

uninstall install icloud restart things and work

Thanks!