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


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

ssl.wrap_socket?

Path csiph.com!news.swapon.de!news.in-chemnitz.de!3.eu.feeder.erje.net!feeder.erje.net!npeer.as286.net!npeer-ng0.as286.net!news.uni-stuttgart.de!.POSTED!not-for-mail
From Ulli Horlacher <framstag@rus.uni-stuttgart.de>
Newsgroups de.comp.lang.python
Subject ssl.wrap_socket?
Date Sun, 23 Mar 2025 01:29:41 -0000 (UTC)
Organization University of Stuttgart, FRG
Message-ID <vrno65$k58$1@rusnews.informatik.uni-stuttgart.de> (permalink)
Injection-Date Sun, 23 Mar 2025 01:29:41 -0000 (UTC)
Injection-Info rusnews.informatik.uni-stuttgart.de; logging-data="20648"; mail-complaints-to="rusnews@informatik.uni-stuttgart.de"
User-Agent tin/2.6.3-20231224 ("Banff") (Linux/5.15.0-134-generic (x86_64))
Xref csiph.com de.comp.lang.python:6268

Show key headers only | View raw


Ich bin dabei ein altes Python2 Programm auf Python3 umzuschreiben.
Ich bekomme da diese Warnung:

/local/home/framstag/python/./fexit.py:905: DeprecationWarning: ssl.wrap_socket() is deprecated, use SSLContext.wrap_socket()

Der Code an dieser Stelle ist:

    sock = ssl.wrap_socket(sock)

Wenn ich das aendere in:

    sock = ssl.SSLContext.wrap_socket(sock)

bricht mir das Programm ab mit dieser Fehlermeldung:

  File "/local/home/framstag/python/./fexit.py", line 905, in http_connect
    sock = ssl.SSLContext.wrap_socket(sock)
TypeError: SSLContext.wrap_socket() missing 1 required positional argument: 'sock'


Ich hab da wohl was nicht verstanden. Wie gehts richtig?


sock hatte ich so erzeugt:

    sock = socket.create_connection((server,port))

-- 
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 | NextNext 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