Announcement

Collapse
No announcement yet.

iCloud Login Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    iCloud Login Problem

    Hi,

    I'm having issues getting PHLocation to create an iCloud user. When I set it up and put in my credentials, it says login failed. Upping the debug level to 2 I see:


    Sep-14 10:27:14 AM PHLocation (hsEvent) Device config change detected for a PI device : 242
    Sep-14 10:27:14 AM PHLocation Error (handleICL) from: 242 msg: (StartService) Auth failed for: <MYAPPLEID> Service startup failed.
    Sep-14 10:27:14 AM PHLocation Error (handleICL) from: 242 msg: (Authenticate) Auth failed for : <MYAPPLEID> Check iCloud user / password is correct.
    Sep-14 10:27:14 AM PHLocation Error (handleICL) from: 242 msg: Prochttp EX: System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.) ---> System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed. at Mono.Security.Protocol.Tls.RecordProtocol.EndReceiveRecord (System.IAsyncResult asyncResult) [0x00037] in :0 at Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRec ord (System.IAsyncResult ar, System.Boolean ignoreEmpty) [0x00000] in :0 at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWor ker (System.IAsyncResult result) [0x00071] in :0 --- End of inner exception stack trace --- at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHands hake (System.IAsyncResult result) [0x00032] in :0 at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallb ack (System.IAsyncResult asyncResult) [0x0000c] in :0 --- End of inner exception stack trace --- at Mono.Security.Protocol.Tls.SslStreamBase.EndRead (System.IAsyncResult asyncResult) [0x0004b] in :0 at Mono.Net.Security.Private.LegacySslStream.EndAuthenticateAsC lient (System.IAsyncResult asyncResult) [0x0000e] in :0 at Mono.Net.Security.Private.LegacySslStream.AuthenticateAsClie nt (System.String targetHost, System.Security.Cryptography.X509Certificates.X509Certificat eCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) [0x0000e] in :0 at Mono.Net.Security.MonoTlsStream.CreateStream (System.Byte[] buffer) [0x0007b] in :0 at System.Net.WebConnection.CreateStream (System.Net.HttpWebRequest request) [0x00073] in :0 --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetRequestStream (System.IAsyncResult asyncResult) [0x0003a] in :0 at System.Net.HttpWebRequest.GetRequestStream () [0x0004e] in :0 at h+d.e (System.String A_0, System.String A_1, System.String A_2, System.Boolean A_3) [0x0008e] in :0
    Sep-14 10:27:14 AM PHLocation (handleICL) from: 242 msg: (Authenticate) Called for: <MYAPPLEID>
    Sep-14 10:27:14 AM PHLocation (StartiCloud) Called.

    Where <MYAPPLEID> is my redacted appleid.

    Any help appreciated. Running 3.0.1.90 in HS3 Standard Edition 3.0.0.326 (Linux) on Raspian Jessie

    Thanks!

    #2
    There was a problem reported with regard to Apple's security requirements and Linux (mono).

    https://forums.homeseer.com/showthread.php?t=187354
    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      Interesting. I'm running mono 5.2.0.215 which /should/ be recent enough to support TLS 1.2

      Comment


        #4
        Originally posted by gschlossnagle View Post
        Interesting. I'm running mono 5.2.0.215 which /should/ be recent enough to support TLS 1.2
        I'll have to defer to Paul (sooty) on this then. I have no Linux experience with HomeSeer. It does seem to be security related.
        HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

        Comment


          #5
          I just tried hitting https://icloud.com from mono using the tlstest tool described here: http://www.mono-project.com/docs/faq/security/

          And that works with no error.

          pi@Homeseer:~/src $ mono --version
          Mono JIT compiler version 5.2.0.215 (tarball Mon Aug 14 16:25:12 UTC 2017)
          Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
          TLS: __thread
          SIGSEGV: normal
          Notifications: epoll
          Architecture: armel,vfp+hard
          Disabled: none
          Misc: softdebug
          LLVM: supported, not enabled.
          GC: sgen (concurrent by default)
          pi@Homeseer:~/src $ mono tlstest.exe --time https://icloud.com/

          https://icloud.com/
          Time: 00:00:01.5145020

          Comment


            #6
            Paul is in the U.K. and this is a busy time of year for his business. He will likely respond by the weekend. His email is linked under support in the help docs.
            HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

            Comment


              #7
              The most recent Linux testing of the plug-in has been done on a VM running Ubuntu 15.10 and Mono 4.8.0.492.

              I just ran a test with 2 iCloud accounts (one with 2FA and one without) on the above setup and it worked as expected.

              It would appear from your log that it is an issue with TLS. I'll install Mono 5x and see if anything rears its head.

              Paul..

              Comment


                #8
                Thanks! mono 5 seems to be what's shipping at least on Debian. I'll also see if I can figure out how to go down to 4.8-current.

                Comment


                  #9
                  It would appear that its not a Mono version issue. I just installed 5.2.0.215 on my VM and it works fine.

                  Can you set debug level to 2 on the plug-in general config page then try to force an update.

                  Email me the resulting HS3 log entries and I'll take a look.

                  Paul..

                  Comment


                    #10
                    I sent you a mail. I feel like I'm on to something though - I think that my debian install is missing the certs to trust the endpoint. I get the same error when I run certmgr against the apple.com site:


                    certmgr -ssl https://apple.com
                    Mono Certificate Manager - version 5.2.0.215
                    Manage X.509 certificates and CRL from stores.
                    Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.


                    Unhandled Exception:
                    System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: Error while sending TLS Alert (Fatal:InternalError): System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. ---> System.Net.Sockets.SocketException: Connection reset by peer
                    at System.Net.Sockets.Socket.EndReceive (System.IAsyncResult asyncResult) [0x00012] in <d2c057d9d34d4e029e580897bd60340c>:0
                    at System.Net.Sockets.NetworkStream.EndRead (System.IAsyncResult asyncResult) [0x00057] in <d2c057d9d34d4e029e580897bd60340c>:0
                    --- End of inner exception stack trace ---


                    What's the domain of the endpoint you authenticate against? I'm going to try and add it manually.

                    Comment


                      #11
                      Hi gschlossnagle, did you figure something out? I'm having the same or similar issue. I've disabled 2FA based on this thread: https://forums.homeseer.com/showthread.php?t=189512

                      But still getting:

                      Code:
                      Oct-02 10:55:23	 	PHLocation	(hsEvent) Device config change detected for a PI device : 59
                      Oct-02 10:55:23	 	PHLocation Error	(handleICL) from: 59 msg: (StartService) Auth failed for: huguetpj@gmail.com Service startup failed.
                      Oct-02 10:55:23	 	PHLocation Error	(handleICL) from: 59 msg: (Authenticate) Auth failed for : huguetpj@gmail.com Check iCloud user / password is correct.
                      Oct-02 10:55:23	 	PHLocation Error	(handleICL) from: 59 msg: Prochttp EX: System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.) ---> System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed. at Mono.Security.Protocol.Tls.RecordProtocol.EndReceiveRecord (System.IAsyncResult asyncResult) <0x71649d90 + 0x000f4> in :0 at Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord (System.IAsyncResult ar, System.Boolean ignoreEmpty) <0x71649ca0 + 0x0002b> in :0 at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (System.IAsyncResult result) <0x71647678 + 0x001b7> in :0 --- End of inner exception stack trace --- at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (System.IAsyncResult result) <0x7164a9b0 + 0x000b8> in :0 at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (System.IAsyncResult asyncResult) <0x7164a6c0 + 0x00093> in :0 --- End of inner exception stack trace --- at Mono.Security.Protocol.Tls.SslStreamBase.EndRead (System.IAsyncResult asyncResult) <0x71645f00 + 0x00134> in :0 at Mono.Net.Security.Private.LegacySslStream.EndAuthenticateAsClient (System.IAsyncResult asyncResult) <0x71645db0 + 0x00047> in :0 at Mono.Net.Security.Private.LegacySslStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) <0x7163f9a0 + 0x0006b> in :0 at Mono.Net.Security.MonoTlsStream.CreateStream (System.Byte[] buffer) <0x7163ef88 + 0x00107> in :0 --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetRequestStream (System.IAsyncResult asyncResult) <0x7162b978 + 0x000e8> in :0 at System.Net.HttpWebRequest.GetRequestStream () <0x71657a08 + 0x000e3> in :0 at h+d.e (System.String A_0, System.String A_1, System.String A_2, System.Boolean A_3) <0x71650158 + 0x002a7> in :0
                      Oct-02 10:55:23	 	PHLocation	(handleICL) from: 59 msg: (Authenticate) Called for: huguetpj@gmail.com
                      Oct-02 10:55:23	 	PHLocation	(StartiCloud) Called.
                      I'm running HS3 ZEE S2 Edition 3.0.0.368 (Linux), but unfortunately I'm not at home right now to check my mono version and run the tests you did.

                      Comment

                      Working...
                      X