This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Tesla Powerwall Local Connection broken with New Release
#8
HTTPS certificate verification is disabled by default. You can try sending a request using raw sockets to check where the remote host closes the connection:
Code:
IP = '192.168.1.9'
data = '{"username":"customer","password":"MYPASS","email":"MY@EMAIL.COM","force_sm_off":false}'

socket = require('socket')
ssl = require('ssl')

params = {
  mode = 'client',
  protocol = 'tlsv1_2',
  verify = 'none',
}

client = socket.tcp()
client:settimeout(1)

res, err = client:connect(IP, 443)
log('connect', res, err)

ctx = ssl.newcontext(params)
client = ssl.wrap(client, ctx)

client:settimeout(1)

res, err = client:dohandshake()
log('dohandshake', res, err)

res, err = client:send(
'POST /api/login/Basic HTTP/1.1' .. '\r\n' ..
'Host: ' .. IP .. '\r\n' ..
'User-Agent: curl/7.64.1' .. '\r\n' ..
'Accept: */*' .. '\r\n' ..
'Connection: close' .. '\r\n' ..
'Content-Type: application/json' .. '\r\n' ..
'Content-Length: ' .. #data .. '\r\n\r\n' ..
data)

log('send', res, err)

res, err, partial = client:receive('*a')
log('receive', res, err, partial)

client:close()
Reply


Messages In This Thread
RE: Tesla Powerwall Local Connection broken with New Release - by admin - 05.07.2021, 08:31

Forum Jump: