Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default certificate doesn't work on windows #37

Open
adrianog opened this issue Jun 11, 2020 · 2 comments
Open

Default certificate doesn't work on windows #37

adrianog opened this issue Jun 11, 2020 · 2 comments
Milestone

Comments

@adrianog
Copy link

A problem with the temporary file created from this was causing a failure.
http://tinyurl.com/ycfs48vu
"Whether the name can be used to open the file a second time, while the named temporary file is still open, varies across platforms (it can be so used on Unix; it cannot on Windows NT or later)."

Solution:
line 61 in hetzner\util\http.py:

        if bundle is None:
            ca_certs = NamedTemporaryFile(delete=False)
            ca_certs.write('\n'.join(
                map(str.strip, self.CA_ROOT_CERT_FALLBACK.splitlines())
            ).encode('ascii'))
            ca_certs.flush()
            cafile = ca_certs.name
            ca_certs.close()
        try:
          self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file,
                                      cert_reqs=ssl.CERT_REQUIRED,
                                      ca_certs=cafile)
        finally:
          if bundle is None:
            try:
              os.remove(bundle)
            except:
              pass
@aszlig aszlig added this to the Version 0.8.3 milestone Jun 20, 2020
@adrianog
Copy link
Author

adrianog commented Jul 9, 2020

@aszlig that said, I could not fully use this on windows because of a bunch of other problems with OS calls.
Some functionality was ok.

Perhaps worth specifying this is Linux only for now.

@aszlig
Copy link
Owner

aszlig commented Oct 3, 2020

@adrianog: In theory only the command line helper should cause trouble on Windows, so I'd be curious which OS calls you stumbled on that were not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants