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


Groups > de.comp.lang.python > #6273

Re: [Python-de] Re: ssl.wrap_socket?

From Ulli Horlacher <framstag@rus.uni-stuttgart.de>
Newsgroups de.comp.lang.python
Subject Re: [Python-de] Re: ssl.wrap_socket?
Date 2025-03-23 10:29 +0000
Organization University of Stuttgart, FRG
Message-ID <vronpn$srv$1@rusnews.informatik.uni-stuttgart.de> (permalink)
References <vrno65$k58$1@rusnews.informatik.uni-stuttgart.de> <7d259392-b0cd-4ed8-81df-b2194f467db8@chrisarndt.de> <vroj87$rg9$1@rusnews.informatik.uni-stuttgart.de> <slrnvtvll1.3l8sk.hjp-usenet4@trintignant.hjp.at> <vromih$rg9$2@rusnews.informatik.uni-stuttgart.de>

Show all headers | View raw


Ulli Horlacher <framstag@rus.uni-stuttgart.de> wrote:

> Ok, so funktionierts nun:
> 
>   sock = socket.create_connection((server,port))
>   (...)
>   if port == 443:
>     sslctx = ssl.create_default_context()
>     sock = sslctx.wrap_socket(sock,server_hostname=server)
> 
> Jetzt kann ich sock zur Kommunikation verwenden, egal ob HTTP oder HTTPS.

Und Beispiellauf:

framstag@moep:~/python: ./fexit.py -T 10000
fexit: upload to fex.belwue.de:443
nettest: 10000 MB in 23 s = 430919 kB/s
fexit: download from fex.belwue.de:443
nettest: 10000 MB in 36 s = 283999 kB/s

Tut also. Prima.

-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK
Universitaet Stuttgart         E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    https://www.tik.uni-stuttgart.de/

Back to de.comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

ssl.wrap_socket? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2025-03-23 01:29 +0000
  [Python-de] Re: ssl.wrap_socket? Christopher Arndt <chris@chrisarndt.de> - 2025-03-23 03:42 +0100
    Re: [Python-de] Re: ssl.wrap_socket? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2025-03-23 09:11 +0000
      Re: [Python-de] Re: ssl.wrap_socket? "Peter J. Holzer" <hjp-usenet4@hjp.at> - 2025-03-23 10:38 +0100
        Re: [Python-de] Re: ssl.wrap_socket? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2025-03-23 10:08 +0000
          Re: [Python-de] Re: ssl.wrap_socket? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2025-03-23 10:29 +0000
          [Python-de] Re: ssl.wrap_socket? Hartmut Goebel <h.goebel@goebel-consult.de> - 2025-03-23 16:25 +0100

csiph-web