Download the Native Client SDK Failed

1491 views
Skip to first unread message

lustersir

unread,
Jan 7, 2014, 9:55:34 PM1/7/14
to native-cli...@googlegroups.com
I followed the instructions of Download the Native Client SDK


On Windows:

> cd nacl_sdk
> naclsdk list

You should see output similar to this:

Bundles:
 I
: installed
 
*: update available …………

But I got the result:
 [<urlopen error [Errno 10053] An established connection was aborted by the software in your host machine>]

I have tried on five  different computers and closed the anti-virus software、the firewall, run CMD as administrator.
Thanks !

By the way, I am in China.
When I use the proxy of GoAgent, I got the following error:

D:\nacl_sdk>naclsdk list
Traceback (most recent call last):
  File "D:\nacl_sdk\sdk_tools\sdk_update_main.py", line 759, in <module>
    sys.exit(main(sys.argv[1:]))
  File "D:\nacl_sdk\sdk_tools\sdk_update_main.py", line 752, in main
    InvokeCommand(args)
  File "D:\nacl_sdk\sdk_tools\sdk_update_main.py", line 741, in InvokeCommand
    command(options, args[1:], config)
  File "D:\nacl_sdk\sdk_tools\sdk_update_main.py", line 510, in Update
    manifest = LoadManifestFromURLs([options.manifest_url] + config.GetSources())
  File "D:\nacl_sdk\sdk_tools\sdk_update_main.py", line 238, in LoadManifestFromURLs
    url_stream = UrlOpen(url)
  File "D:\nacl_sdk\sdk_tools\sdk_update_main.py", line 114, in UrlOpen
    return url_opener.open(request)
  File "C:\Python27\lib\urllib2.py", line 404, in open
    response = self._open(req, data)
  File "C:\Python27\lib\urllib2.py", line 422, in _open
    '_open', req)
  File "C:\Python27\lib\urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "D:\nacl_sdk\sdk_tools\third_party\fancy_urllib\__init__.py", line 342, in do_open
    req)
  File "C:\Python27\lib\urllib2.py", line 1181, in do_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "C:\Python27\lib\httplib.py", line 973, in request
    self._send_request(method, url, body, headers)
  File "C:\Python27\lib\httplib.py", line 1007, in _send_request
    self.endheaders(body)
  File "C:\Python27\lib\httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "C:\Python27\lib\httplib.py", line 829, in _send_output
    self.send(msg)
  File "C:\Python27\lib\httplib.py", line 791, in send
    self.connect()
  File "D:\nacl_sdk\sdk_tools\third_party\fancy_urllib\__init__.py", line 158, in connect
    'hostname mismatch')
third_party.fancy_urllib.InvalidCertificateException: Host commondatastorage.googleapis.com returned an invalid certific
ate (hostname mismatch): {'notAfter': 'Apr 10 00:00:00 2014 GMT', 'subjectAltName': (('DNS', 'mail.google.com'),), 'subj
ect': ((('countryName', u'US'),), (('stateOrProvinceName', u'California'),), (('localityName', u'Mountain View'),), (('o
rganizationName', u'Google Inc'),), (('commonName', u'mail.google.com'),))}
Traceback (most recent call last):
  File "D:\nacl_sdk\sdk_tools\sdk_update_main.py", line 759, in <module>
    sys.exit(main(sys.argv[1:]))
  File "D:\nacl_sdk\sdk_tools\sdk_update_main.py", line 752, in main
    InvokeCommand(args)
  File "D:\nacl_sdk\sdk_tools\sdk_update_main.py", line 741, in InvokeCommand
    command(options, args[1:], config)
  File "D:\nacl_sdk\sdk_tools\sdk_update_main.py", line 444, in List
    manifest = LoadManifestFromURLs([options.manifest_url] + config.GetSources())
  File "D:\nacl_sdk\sdk_tools\sdk_update_main.py", line 238, in LoadManifestFromURLs
    url_stream = UrlOpen(url)
  File "D:\nacl_sdk\sdk_tools\sdk_update_main.py", line 114, in UrlOpen
    return url_opener.open(request)
  File "C:\Python27\lib\urllib2.py", line 404, in open
    response = self._open(req, data)
  File "C:\Python27\lib\urllib2.py", line 422, in _open
    '_open', req)
  File "C:\Python27\lib\urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "D:\nacl_sdk\sdk_tools\third_party\fancy_urllib\__init__.py", line 342, in do_open
    req)
  File "C:\Python27\lib\urllib2.py", line 1181, in do_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "C:\Python27\lib\httplib.py", line 973, in request
    self._send_request(method, url, body, headers)
  File "C:\Python27\lib\httplib.py", line 1007, in _send_request
    self.endheaders(body)
  File "C:\Python27\lib\httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "C:\Python27\lib\httplib.py", line 829, in _send_output
    self.send(msg)
  File "C:\Python27\lib\httplib.py", line 791, in send
    self.connect()
  File "D:\nacl_sdk\sdk_tools\third_party\fancy_urllib\__init__.py", line 158, in connect
    'hostname mismatch')
third_party.fancy_urllib.InvalidCertificateException: Host commondatastorage.googleapis.com returned an invalid certific
ate (hostname mismatch): {'notAfter': 'Apr 10 00:00:00 2014 GMT', 'subjectAltName': (('DNS', 'mail.google.com'),), 'subj
ect': ((('countryName', u'US'),), (('stateOrProvinceName', u'California'),), (('localityName', u'Mountain View'),), (('o
rganizationName', u'Google Inc'),), (('commonName', u'mail.google.com'),))}

D:\nacl_sdk>

Tim Anderson

unread,
Jun 21, 2014, 1:14:26 PM6/21/14
to native-cli...@googlegroups.com
If you are behind a proxy, this is hard because the certificate you will get back is not in their trusted list.
You could turn off certificates by bypassing the way it accesses the data, changing from https to http.  There is a security risk, but I think it is small.

Edit the file:
nacl_sdk/sdk_tools/sdk_update_main.py

Change the function "UrlOpen(url)" in the following way:

replace any URL that uses https and replace with http
  request = fancy_urllib.FancyRequest(url.replace("https://", "http://"))
Then change the urllib2 call to only be a simple http open call, instead of the other fancy stuff

Here is the full function with replaces:
-----------------------------------------------------------------------------------------------------
def UrlOpen(url):
  
  request = fancy_urllib.FancyRequest(url.replace("https://", "http://"))
  ca_certs = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                          'cacerts.txt')
  request.set_ssl_info(ca_certs=ca_certs)
#  url_opener = urllib2.build_opener(
#      fancy_urllib.FancyProxyHandler(),
#      fancy_urllib.FancyRedirectHandler(),
#      fancy_urllib.FancyHTTPSHandler())
  url_opener = urllib2.build_opener()
  url_opener.addheaders = [('User-agent', 'Mozilla/5.0')]
  return url_opener.open(request)
-----------------------------------------------------------------------------------------------------

skyler...@gmail.com

unread,
Mar 9, 2017, 11:21:58 AM3/9/17
to Native-Client-Discuss
Yes, it works. BTW, the UrlOpen function has been moved to download.py in the latest version of nacl. Thank you!

longfe...@gmail.com

unread,
Jun 22, 2018, 1:19:56 AM6/22/18
to Native-Client-Discuss
in the latest version,  replace the UrlOpen function at  download.py.  it works,  Thank  you!

在 2017年3月10日星期五 UTC+8上午12:21:58,skyler...@gmail.com写道:

sunmi...@gmail.com

unread,
Aug 16, 2018, 10:07:07 AM8/16/18
to Native-Client-Discuss
Yes, it works. BTW, the UrlOpen function has been moved to download.py in the latest version of nacl. Thank you!

在 2014年6月22日星期日 UTC+8上午1:14:26,Tim Anderson写道:
Reply all
Reply to author
Forward
0 new messages