简体   繁体   English

Google TV配对协议 - Go的SSL握手错误(golang)

[英]Google TV Pairing Protocol — SSL Handshake Error with Go (golang)

I'm writing a Go package for the Google TV Pairing Protocol. 我正在为Google TV配对协议编写一个Go包。 But I seem to be hitting a problem with the TLS handshake. 但我似乎在解决TLS握手问题。

sock, err := tls.Dial("tcp", "10.8.0.1:9552", &tls.Config{InsecureSkipVerify: true})

That line gives me a handshake error. 该行给了我握手错误。 The exact error message is: remote error: handshake failure . 确切的错误消息是: remote error: handshake failure If I try the same host/port via curl, it gives curl: (35) error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure as well. 如果我通过curl尝试相同的主机/端口,它会产生curl: (35) error:14094410:SSL routines:SSL3_READ_BYTES:sslv3警报握手失败。

Any ideas? 有任何想法吗? Is the Google TV expecting a client cert maybe? Google TV是否期望获得客户端证书? I haven't seen any references to the need for a client cert anywhere. 我在任何地方都没有看到任何对客户端证书的需求。

If anyone wants to help figure it out, here's the code: https://github.com/dustywilson/go-polo 如果有人想帮忙搞清楚,请输入以下代码: https//github.com/dustywilson/go-polo

The README file has the easy code to check it out. README文件有简单的代码来检查它。 You will have to know the IP address for your Google TV box since this doesn't use mDNS. 您必须知道Google TV电视盒的IP地址,因为这不使用mDNS。 If you (someone, anyone) run this and you get different results, let me know. 如果你(某人,任何人)运行这个并得到不同的结果,请告诉我。

I've already gone through the Google TV Remote code at google-tv-remote . 我已经通过google-tv-remote浏览了Google TV远程代码。 A more useful one is google-tv-pairing-protocol which is the equivalent Java/Android project to what I'm doing. 一个更有用的是google-tv-pairing-protocol ,这是我正在做的事情的等效Java / Android项目。 Of course I've already poured over that code. 当然我已经倾倒了那段代码。 I think it's a problem either with Go itself (unlikely), a problem with the Go TLS package not knowing how to read the Google TV's certificate (I know it was a problem a year ago), or a problem with my code (typically would be most likely, but I'm just not seeing it). 我认为Go本身(不太可能)是一个问题,Go TLS包的问题不知道如何阅读Google TV的证书(我知道这是一年前的问题),或者我的代码有问题(通常会最有可能,但我只是没有看到它。

By the way, I'm testing this on a Logitech Revue and it has a self-signed SSL certificate. 顺便说一句,我在Logitech Revue上测试它,它有一个自签名的SSL证书。 It's not rooted or modified in any way. 它没有任何根源或修改。

My resulting code will be open source, of course. 当然,我的结果代码将是开源的。 Thanks for the assistance. 谢谢你的帮助。

Client certs are generated by the Java remote client at runtime, and stored for future use. 客户端证书由Java远程客户端在运行时生成,并存储以供将来使用。 Check out the code at: 查看代码:

http://code.google.com/p/google-tv-remote/source/browse/src/com/google/android/apps/tvremote/KeyStoreManager.java http://code.google.com/p/google-tv-remote/source/browse/src/com/google/android/apps/tvremote/KeyStoreManager.java

You might be running into an invalid cert. 您可能遇到了无效的证书。 According to the code, you need a specific CN. 根据代码,您需要一个特定的CN。

/* Returns the name that should be used in a new certificate. / *返回应在新证书中使用的名称。 * The format is: "CN=anymote/PRODUCT/DEVICE/MODEL/unique identifier" */ *格式为:“CN = anymote / PRODUCT / DEVICE / MODEL / unique identifier”* /

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM