Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #98931

Re: HTTPSConnection from http.client?

From Alex Naumov <alexander_naumov@opensuse.org>
Newsgroups comp.lang.python
Subject Re: HTTPSConnection from http.client?
Date 2015-11-17 16:47 +0100
Message-ID <mailman.394.1447775667.16136.python-list@python.org> (permalink)
References <CABPy6+zYvqmOFy7aMNMH0DtUNaaJ3M3nR47QPhDPijsvN2jHbA@mail.gmail.com> <n2f2mb$qoo$1@ger.gmane.org> <CABPy6+zTajMJ8uoPxADbs7hzhVt31XoxGg_NZtaTYwL=LDMwBw@mail.gmail.com> <n2f9qv$gv4$1@ger.gmane.org>

Show all headers | View raw


Hello Peter,

thanks for your reply.

>>> import ssl

Works well in python2 and 3.

Maybe somebody know another way to create a SSL connection (username/password)?
I just need to log in and log out.

Thanks,
Alex

On Tue, Nov 17, 2015 at 2:24 PM, Peter Otten <__peter__@web.de> wrote:
> Alex Naumov wrote:
>
>> On Tue, Nov 17, 2015 at 12:22 PM, Peter Otten <__peter__@web.de> wrote:
>>> Alex Naumov wrote:
>>>
>>>> Hello,
>>>>
>>>> does anybody know how to create a HTTPS connections in python2 or
>>>> python3? I tried second day to do that with http.client[1], but every
>>>> time get error:
>>>>
>>>> from http.client import HTTPSConnection
>>>> ImportError: cannot import name HTTPSConnection
>>>>
>>>>
>>>> Where is HTTPSConnection located? Which module?
>>>>
>>>> I use openSUSE 13.1 x86_64.
>>>>
>>>> Thank you,
>>>> Alex
>>>>
>>>>
>>>> [1] https://docs.python.org/3/library/http.client.html
>>>
>>> Did you compile Python from source?
>>
>> No, I install it as a package.
>>
>>> You may be missing the development
>>> packages.
>>
>> Yes, it looks like some packages are not there.
>>
>>
>>> On a minimal SLES-12-x86_64 installation:
>>
>> Can you tell me what's the name of package with http.client module please?
>
> You already have that module as it is part of the Python standard
> installation. You can double check by importing something that is always
> available. E. g. the following should succeed on your system
>
>>>> from http.client import HTTPConnection
>>>>
>
> What you are likely missing is ssl support. Try
>
>>>> import ssl
>
> to verify that it fails and post the traceback.
>
> Unfortunately my conclusion from Marco's post is that
>
>>>> from http.client import HTTPSConnection
>
> should succeed on your system without the need for additional packages.
> Something seems to be broken, but I have no idea what, sorry.
>
> --
> https://mail.python.org/mailman/listinfo/python-list

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: HTTPSConnection from http.client? Alex Naumov <alexander_naumov@opensuse.org> - 2015-11-17 16:47 +0100

csiph-web