Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HttpClient issue resolving IP
#21
Dean Roddey Wrote:It's worse than that, you'd have to do an SSL enabled HTTP client, which you can't do in CML. Did the other tool also do a 1.1 persistent connection?

Yes, I thought of that later - seems currently impossible.

I used curl to make the requests and by default it uses HTTP 1.1, but when I tell it to do HTTP 1.0, it also seems to work...

Not sure what the issue is with the CQC HttpClient.
Reply
#22
You could setup stunnel to encrypt it for you on another machine. Then you would have traffic in the clear you can take captures against to help you troubleshoot.
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#23
wuench Wrote:You could setup stunnel to encrypt it for you on another machine. Then you would have traffic in the clear you can take captures against to help you troubleshoot.

I run into problems even if I try to go with an unencrypted connection.

If I hit port 80 with a browser or curl or netcat, I get a 301 redirect to secure connection.

If I hit port 80 with the CQC HttpClient, I get a 400 bad request.

I've used netcat to simulate the exact request that is being made by the CQC HttpClient and it works. I captured the request via a network sniffer app and used that to make the netcat request.

The only possibility I can think of is if there is some sort of unprintable character in the request somewhere that doesn't show up on the network traffic sniffer. Or something else very weird about the HttpClient.
Reply
#24
It will show up in the binary data on the sniffer, or another clue is if the content lengths don't match.

If you want to post the good and bad I can give you a second set of eyes...
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#25
wuench Wrote:It will show up in the binary data on the sniffer, or another clue is if the content lengths don't match.

If you want to post the good and bad I can give you a second set of eyes...

I'll take you up on that - let me get some new captures and I'll post
Reply
#26
wuench Wrote:It will show up in the binary data on the sniffer, or another clue is if the content lengths don't match.

If you want to post the good and bad I can give you a second set of eyes...

Here are some traces, but they are not currently apples to apples:

CQC:

==================================================
Index : 1
Protocol : TCP
Local Address : 192.168.1.10
Remote Address : 54.243.175.226
Local Port : 3796
Remote Port : 80
Local Host : automation2.hsd1.ga.comcast.net.
Remote Host : ec2-54-243-175-226.compute-1.amazonaws.com
Service Name : http
Packets : 7
Data Size : 471 Bytes
Total Size : 1,196 Bytes
Data Speed : 7.3 KB/Sec
Capture Time : 3/5/2013 7:39:05 PM:375
Last Packet Time : 3/5/2013 7:39:05 PM:437
Local MAC Address : 00-07-e9-de-8f-ba
Remote MAC Address: 70-56-81-c8-70-f3
Local IP Country :
Remote IP Country :
==================================================

00000000 47 45 54 20 2F 75 73 65 72 2F 6C 6F 67 69 6E 20 GET /use r/login
00000010 20 48 54 54 50 2F 31 2E 30 0D 0A 48 6F 73 74 3A HTTP/1. 0..Host:
00000020 20 68 6F 6D 65 2E 6E 65 73 74 2E 63 6F 6D 0D 0A home.ne st.com..
00000030 55 73 65 72 2D 41 67 65 6E 74 3A 20 4D 6F 7A 69 User-Age nt: Mozi
00000040 6C 6C 61 2F 35 2E 30 20 28 57 69 6E 64 6F 77 73 lla/5.0 (Windows
00000050 20 4E 54 20 35 2E 31 29 20 41 70 70 6C 65 57 65 NT 5.1) AppleWe
00000060 62 4B 69 74 2F 35 33 37 2E 32 32 20 28 4B 48 54 bKit/537 .22 (KHT
00000070 4D 4C 2C 20 6C 69 6B 65 20 47 65 63 6B 6F 29 20 ML, like Gecko)
00000080 43 68 72 6F 6D 65 2F 32 35 2E 30 2E 31 33 36 34 Chrome/2 5.0.1364
00000090 2E 39 37 20 53 61 66 61 72 69 2F 35 33 37 2E 32 .97 Safa ri/537.2
000000A0 32 0D 0A 41 63 63 65 70 74 3A 20 74 65 78 74 2F 2..Accep t: text/
000000B0 68 74 6D 6C 2C 61 70 70 6C 69 63 61 74 69 6F 6E html,app lication
000000C0 2F 78 68 74 6D 6C 2B 78 6D 6C 2C 61 70 70 6C 69 /xhtml+x ml,appli
000000D0 63 61 74 69 6F 6E 2F 78 6D 6C 3B 71 3D 30 2E 39 cation/x ml;q=0.9
000000E0 2C 2A 2F 2A 3B 71 3D 30 2E 38 0D 0A 41 63 63 65 ,*/*;q=0 .8..Acce
000000F0 70 74 2D 45 6E 63 6F 64 69 6E 67 3A 20 67 7A 69 pt-Encod ing: gzi
00000100 70 2C 64 65 66 6C 61 74 65 2C 73 64 63 68 0D 0A p,deflat e,sdch..
00000110 41 63 63 65 70 74 2D 4C 61 6E 67 75 61 67 65 3A Accept-L anguage:
00000120 20 65 6E 2D 55 53 2C 65 6E 3B 71 3D 30 2E 38 0D en-US,e n;q=0.8.
00000130 0A 41 63 63 65 70 74 2D 43 68 61 72 73 65 74 3A .Accept- Charset:
00000140 20 49 53 4F 2D 38 38 35 39 2D 31 2C 75 74 66 2D ISO-885 9-1,utf-
00000150 38 3B 71 3D 30 2E 37 2C 2A 3B 71 3D 30 2E 33 0D 8;q=0.7, *;q=0.3.
00000160 0A 43 61 63 68 65 2D 43 6F 6E 74 72 6F 6C 3A 20 .Cache-C ontrol:
00000170 6D 61 78 2D 61 67 65 3D 30 0D 0A 43 6F 6E 6E 65 max-age= 0..Conne
00000180 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 ction: k eep-aliv
00000190 65 0D 0A 0D 0A e....

00000000 48 54 54 50 2F 31 2E 31 20 34 30 30 20 42 41 44 HTTP/1.1 400 BAD
00000010 5F 52 45 51 55 45 53 54 0D 0A 43 6F 6E 74 65 6E _REQUEST ..Conten
00000020 74 2D 4C 65 6E 67 74 68 3A 20 30 0D 0A 43 6F 6E t-Length : 0..Con
00000030 6E 65 63 74 69 6F 6E 3A 20 43 6C 6F 73 65 0D 0A nection: Close..
00000040 0D 0A ..


Chrome:
==================================================
Index : 3
Protocol : TCP
Local Address : 192.168.1.10
Remote Address : 23.23.120.33
Local Port : 3835
Remote Port : 80
Local Host : automation2.hsd1.ga.comcast.net.
Remote Host : ec2-23-23-120-33.compute-1.amazonaws.com
Service Name : http
Packets : 4
Data Size : 1,059 Bytes
Total Size : 1,928 Bytes
Data Speed : 3.0 KB/Sec
Capture Time : 3/5/2013 7:43:49 PM:171
Last Packet Time : 3/5/2013 7:43:49 PM:515
Local MAC Address : 00-07-e9-de-8f-ba
Remote MAC Address: 70-56-81-c8-70-f3
Local IP Country :
Remote IP Country :
==================================================

00000000 47 45 54 20 2F 75 73 65 72 2F 6C 6F 67 69 6E 20 GET /use r/login
00000010 48 54 54 50 2F 31 2E 31 0D 0A 48 6F 73 74 3A 20 HTTP/1.1 ..Host:
00000020 68 6F 6D 65 2E 6E 65 73 74 2E 63 6F 6D 0D 0A 43 home.nes t.com..C
00000030 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D onnectio n: keep-
00000040 61 6C 69 76 65 0D 0A 43 61 63 68 65 2D 43 6F 6E alive..C ache-Con
00000050 74 72 6F 6C 3A 20 6D 61 78 2D 61 67 65 3D 30 0D trol: ma x-age=0.
00000060 0A 41 63 63 65 70 74 3A 20 74 65 78 74 2F 68 74 .Accept: text/ht
00000070 6D 6C 2C 61 70 70 6C 69 63 61 74 69 6F 6E 2F 78 ml,appli cation/x
00000080 68 74 6D 6C 2B 78 6D 6C 2C 61 70 70 6C 69 63 61 html+xml ,applica
00000090 74 69 6F 6E 2F 78 6D 6C 3B 71 3D 30 2E 39 2C 2A tion/xml ;q=0.9,*
000000A0 2F 2A 3B 71 3D 30 2E 38 0D 0A 55 73 65 72 2D 41 /*;q=0.8 ..User-A
000000B0 67 65 6E 74 3A 20 4D 6F 7A 69 6C 6C 61 2F 35 2E gent: Mo zilla/5.
000000C0 30 20 28 57 69 6E 64 6F 77 73 20 4E 54 20 35 2E 0 (Windo ws NT 5.
000000D0 31 29 20 41 70 70 6C 65 57 65 62 4B 69 74 2F 35 1) Apple WebKit/5
000000E0 33 37 2E 32 32 20 28 4B 48 54 4D 4C 2C 20 6C 69 37.22 (K HTML, li
000000F0 6B 65 20 47 65 63 6B 6F 29 20 43 68 72 6F 6D 65 ke Gecko ) Chrome
00000100 2F 32 35 2E 30 2E 31 33 36 34 2E 39 37 20 53 61 /25.0.13 64.97 Sa
00000110 66 61 72 69 2F 35 33 37 2E 32 32 0D 0A 41 63 63 fari/537 .22..Acc
00000120 65 70 74 2D 45 6E 63 6F 64 69 6E 67 3A 20 67 7A ept-Enco ding: gz
00000130 69 70 2C 64 65 66 6C 61 74 65 2C 73 64 63 68 0D ip,defla te,sdch.
00000140 0A 41 63 63 65 70 74 2D 4C 61 6E 67 75 61 67 65 .Accept- Language
00000150 3A 20 65 6E 2D 55 53 2C 65 6E 3B 71 3D 30 2E 38 : en-US, en;q=0.8
00000160 0D 0A 41 63 63 65 70 74 2D 43 68 61 72 73 65 74 ..Accept -Charset
00000170 3A 20 49 53 4F 2D 38 38 35 39 2D 31 2C 75 74 66 : ISO-88 59-1,utf
00000180 2D 38 3B 71 3D 30 2E 37 2C 2A 3B 71 3D 30 2E 33 -8;q=0.7 ,*;q=0.3
00000190 0D 0A 43 6F 6F 6B 69 65 3A 20 43 6F 6E 73 6F 6C ..Cookie : Consol
000001A0 65 3D 73 65 6C 76 77 25 33 44 73 65 64 33 39 36 e=selvw% 3Dsed396
000001B0 36 32 30 2D 37 65 30 65 2D 31 31 65 32 2D 61 64 620-7e0e -11e2-ad
000001C0 33 36 2D 31 32 33 31 33 39 32 38 61 63 39 66 25 36-12313 928ac9f%
000001D0 33 42 74 61 62 6F 25 33 44 66 61 6C 73 65 3B 20 3Btabo%3 Dfalse;
000001E0 63 73 72 66 74 6F 6B 65 6E 3D 33 61 34 65 62 35 csrftoke n=3a4eb5
000001F0 31 62 64 34 31 36 34 37 35 38 30 39 36 39 37 64 1bd41647 5809697d
00000200 34 31 64 36 38 66 32 65 63 36 3B 20 5F 5F 75 74 41d68f2e c6; __ut
00000210 6D 61 3D 32 31 33 33 34 34 32 36 37 2E 31 31 31 ma=21334 4267.111
00000220 36 36 34 35 36 36 35 2E 31 33 36 32 33 33 35 39 6645665. 13623359
00000230 33 30 2E 31 33 36 32 33 33 35 39 33 30 2E 31 33 30.13623 35930.13
00000240 36 32 33 33 38 30 31 35 2E 32 3B 20 5F 5F 75 74 62338015 .2; __ut
00000250 6D 7A 3D 32 31 33 33 34 34 32 36 37 2E 31 33 36 mz=21334 4267.136
00000260 32 33 33 35 39 33 30 2E 31 2E 31 2E 75 74 6D 63 2335930. 1.1.utmc
00000270 73 72 3D 28 64 69 72 65 63 74 29 7C 75 74 6D 63 sr=(dire ct)|utmc
00000280 63 6E 3D 28 64 69 72 65 63 74 29 7C 75 74 6D 63 cn=(dire ct)|utmc
00000290 6D 64 3D 28 6E 6F 6E 65 29 0D 0A 0D 0A md=(none )....

00000000 48 54 54 50 2F 31 2E 31 20 33 30 31 20 4D 6F 76 HTTP/1.1 301 Mov
00000010 65 64 20 50 65 72 6D 61 6E 65 6E 74 6C 79 0D 0A ed Perma nently..
00000020 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20 74 65 Content- Type: te
00000030 78 74 2F 68 74 6D 6C 0D 0A 44 61 74 65 3A 20 57 xt/html. .Date: W
00000040 65 64 2C 20 30 36 20 4D 61 72 20 32 30 31 33 20 ed, 06 M ar 2013
00000050 30 30 3A 34 32 3A 33 32 20 47 4D 54 0D 0A 4C 6F 00:42:32 GMT..Lo
00000060 63 61 74 69 6F 6E 3A 20 68 74 74 70 73 3A 2F 2F cation: https://
00000070 68 6F 6D 65 2E 6E 65 73 74 2E 63 6F 6D 2F 75 73 home.nes t.com/us
00000080 65 72 2F 6C 6F 67 69 6E 0D 0A 53 65 72 76 65 72 er/login ..Server
00000090 3A 20 6E 67 69 6E 78 2F 31 2E 32 2E 34 0D 0A 43 : nginx/ 1.2.4..C
000000A0 6F 6E 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 31 ontent-L ength: 1
000000B0 38 34 0D 0A 43 6F 6E 6E 65 63 74 69 6F 6E 3A 20 84..Conn ection:
000000C0 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 0D 0A 3C 68 keep-ali ve....<h
000000D0 74 6D 6C 3E 0D 0A 3C 68 65 61 64 3E 3C 74 69 74 tml>..<h ead><tit
000000E0 6C 65 3E 33 30 31 20 4D 6F 76 65 64 20 50 65 72 le>301 M oved Per
000000F0 6D 61 6E 65 6E 74 6C 79 3C 2F 74 69 74 6C 65 3E manently </title>
00000100 3C 2F 68 65 61 64 3E 0D 0A 3C 62 6F 64 79 20 62 </head>. .<body b
00000110 67 63 6F 6C 6F 72 3D 22 77 68 69 74 65 22 3E 0D gcolor=" white">.
00000120 0A 3C 63 65 6E 74 65 72 3E 3C 68 31 3E 33 30 31 .<center ><h1>301
00000130 20 4D 6F 76 65 64 20 50 65 72 6D 61 6E 65 6E 74 Moved P ermanent
00000140 6C 79 3C 2F 68 31 3E 3C 2F 63 65 6E 74 65 72 3E ly</h1>< /center>
00000150 0D 0A 3C 68 72 3E 3C 63 65 6E 74 65 72 3E 6E 67 ..<hr><c enter>ng
00000160 69 6E 78 2F 31 2E 32 2E 34 3C 2F 63 65 6E 74 65 inx/1.2. 4</cente
00000170 72 3E 0D 0A 3C 2F 62 6F 64 79 3E 0D 0A 3C 2F 68 r>..</bo dy>..</h
00000180 74 6D 6C 3E 0D 0A tml>..
Reply
#27
A Curl trace (HTTP 1.0)
* About to connect() to home.nest.com port 80 (#0)
* Trying 23.23.120.33...
* connected
* Connected to home.nest.com (23.23.120.33) port 80 (#0)
> GET /user/login HTTP/1.0
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
> Host: home.nest.com
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Content-Type: text/html
< Date: Wed, 06 Mar 2013 01:21:14 GMT
< Location: https://home.nest.com/user/login
< Server: nginx/1.2.4
< Content-Length: 184
< Connection: Close
<
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.2.4</center>
</body>
</html>
* Closing connection #0
Reply
#28
CQC Text Trace
==================================================
Index : 1
Protocol : TCP
Local Address : 192.168.1.10
Remote Address : 54.243.175.226
Local Port : 3796
Remote Port : 80
Local Host : automation2.hsd1.ga.comcast.net.
Remote Host : ec2-54-243-175-226.compute-1.amazonaws.com
Service Name : http
Packets : 7
Data Size : 471 Bytes
Total Size : 1,196 Bytes
Data Speed : 7.3 KB/Sec
Capture Time : 3/5/2013 7:39:05 PM:375
Last Packet Time : 3/5/2013 7:39:05 PM:437
Local MAC Address : 00-07-e9-de-8f-ba
Remote MAC Address: 70-56-81-c8-70-f3
Local IP Country :
Remote IP Country :
==================================================

GET /user/login HTTP/1.0
Host: home.nest.com
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cache-Control: max-age=0
Connection: keep-alive


HTTP/1.1 400 BAD_REQUEST
Content-Length: 0
Connection: Close


Browser Text Trace
==================================================
Index : 3
Protocol : TCP
Local Address : 192.168.1.10
Remote Address : 23.23.120.33
Local Port : 3835
Remote Port : 80
Local Host : automation2.hsd1.ga.comcast.net.
Remote Host : ec2-23-23-120-33.compute-1.amazonaws.com
Service Name : http
Packets : 4
Data Size : 1,059 Bytes
Total Size : 1,928 Bytes
Data Speed : 3.0 KB/Sec
Capture Time : 3/5/2013 7:43:49 PM:171
Last Packet Time : 3/5/2013 7:43:49 PM:515
Local MAC Address : 00-07-e9-de-8f-ba
Remote MAC Address: 70-56-81-c8-70-f3
Local IP Country :
Remote IP Country :
==================================================

GET /user/login HTTP/1.1
Host: home.nest.com
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: Console=selvw%3Dsed396620-7e0e-11e2-ad36-12313928ac9f%3Btabo%3Dfalse; csrftoken=3a4eb51bd416475809697d41d68f2ec6; __utma=213344267.1116645665.1362335930.1362335930.1362338015.2; __utmz=213344267.1362335930.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)


HTTP/1.1 301 Moved Permanently
Content-Type: text/html
Date: Wed, 06 Mar 2013 00:42:32 GMT
Location: https://home.nest.com/user/login
Server: nginx/1.2.4
Content-Length: 184
Connection: keep-alive

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.2.4</center>
</body>
</html>
Reply
#29
This may be obvious, but are you using the regular SendGET for the initial http page, and then SendSSLGET() for any https URLs? SendSSLGET() is always going to do an SSL connection, so you will need to use the regular GET for non-SSL URLs.
Dean Roddey
Explorans limites defectum
Reply
#30
I am not seeing issues in what you posted either. I did a telnet and pasted your CQC Text from above and it gave me the 301.

Can you post the CML code snippit you are using to send the request? Easier than me recreating it.
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  4.5.20 autogen calendar questions... this is just a curiusity thing...no issue per se SomeWhatLost 3 2,454 10-13-2014, 08:00 PM
Last Post: Dean Roddey
  Auto-Gen Issue Two finish.06 9 3,607 08-26-2014, 08:08 AM
Last Post: Dean Roddey
  Auto Gen Issue DaveB 6 2,920 08-22-2014, 07:36 AM
Last Post: dgilpin
  916 and 920 calc issue bbrendon 9 3,692 04-07-2013, 09:51 PM
Last Post: Dean Roddey
  918 AutoGen Issue Bugman 18 6,602 04-05-2013, 12:37 PM
Last Post: Bugman
  Timed field issue karenlee 6 2,852 02-21-2013, 03:47 AM
Last Post: karenlee
  3.3.6 driver issue rm1759 2 2,829 08-16-2010, 11:31 AM
Last Post: rm1759
  LAST issue I've found with Zoomplayer Roscoe62 0 1,760 05-03-2009, 12:31 AM
Last Post: Roscoe62
  2.0.11 IV issue, well maybe... might be something else... SomeWhatLost 11 5,564 01-27-2007, 01:42 PM
Last Post: Dean Roddey
  2.2.7 Theatertek driver issue I am having 0 581 Less than 1 minute ago
Last Post:

Forum Jump:


Users browsing this thread: 1 Guest(s)