homebridge-samsung-airconditioner icon indicating copy to clipboard operation
homebridge-samsung-airconditioner copied to clipboard

TLS-Handshake is failing when trying to obtain TOKEN from Aircondition

Open stodla123 opened this issue 4 years ago • 1 comments

Dear Author,

since i'm already quite desperate with including my aircon to my homebride i was wondering if you could help me out on this one.

Some stats: -Model is AR12KSWSBWKN, works with "Smarthings" on wifi. -Homebridge is running on PI4 -WIFI-AP set up by PI and Aircon directly connected -IP is correct and can be pinged: Anmerkung 2020-06-21 131858

Server8889.py is up and running: image Then i do this with curl: curl -k -H "Content-Type: application/json" -H "DeviceToken: xxxxxxxxxxx" --tlsv1.3 --verbose --progress-bar --cert /home/pi/Documents/ac14k_m.pem --insecure -X POST https://192.168.4.15:8888/devicetoken/request

Since connection was refused before: i added the Option —tlsv1.3

(Unknown ssl Protocol Error was Stated with latest Version)

The .pem file is present as well and has 777 privileges.

The command unfortnuatelly gives me the following error:

image

Could anyone help me with this one please?

Here is my Server8889.py

pi@raspberrypi:~/Documents $ cat Server8889.py from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from optparse import OptionParser import ssl

class RequestHandler(BaseHTTPRequestHandler):

def do_GET(self):

    request_path = self.path

    print("\n----- Request Start ----->\n")
    print(request_path)
    print(self.headers)
    print("<----- Request End -----\n")

    self.send_response(200)
    self.send_header("Set-Cookie", "foo=bar")
    self.send_header()

def do_POST(self):

    request_path = self.path

    print("\n----- Request Start ----->\n")
    print(request_path)

    request_headers = self.headers
    content_length = request_headers.getheaders('content-length')
    length = int(content_length[0]) if content_length else 0

    print(request_headers)
    print(self.rfile.read(length))
    print(self)
    print("<----- Request End -----\n")

    self.send_response(200)

do_PUT = do_POST
do_DELETE = do_GET

def main(): port = 8889 print('Listening on localhost:%s' % port) server = HTTPServer(('', port), RequestHandler) server.socket = ssl.wrap_socket(server.socket, certfile='/home/pi/Documents/ac14k_m.pem', server_side=True) server.serve_forever()

if name == "main":


Some further questions: -is there something Else to be installed, or to be replaced in the scripts? -which tls Version should be used, did you use and what was the config? (Especially in connection with python)

-which Port should be used? 8888 or 8889? How can this be determined?

-what is the exact sequence to Follow that been testet to be working? What i did: 1.) run server.py 2.) AC - connect to Power socket. no actual Switch on via Remote. (some few seconds later, then Ping was possible) 3.) run curl request I did step 2 and 3 almost the Same time approx. 1-3 secs delay.

Is That the correct Procedure?

Glad for any hint and input

THANK YOU IN ADVANCE!!!

stodla123 avatar Jun 21 '20 11:06 stodla123

if you are in a new system you must use tls versione 1.0

cicciovo avatar Dec 31 '21 11:12 cicciovo