Skip to content

Python 3.12 SSL compatibility: ssl.wrap_socket removed #1190

@deekshithaby

Description

@deekshithaby

Problem

Python 3.12 removed the deprecated ssl.wrap_socket() function, causing Nettacker's SSL scanning functionality to fail on Python 3.12+.

Impact

  • SSL weak version detection broken
  • SSL weak cipher detection broken
  • Users on Python 3.12+ cannot use Nettacker

Root Cause

The deprecated ssl.wrap_socket() was removed in Python 3.12. Nettacker needs to use the modern ssl.SSLContext().wrap_socket() API instead.

Solution

Replace ssl.wrap_socket() with ssl.SSLContext().wrap_socket() throughout the codebase with proper certificate verification settings.

Testing Completed

  • ✅ Full Nettacker scan completed successfully on Python 3.12.3
  • ✅ All 117 modules loaded without errors
  • ✅ SSL weak version detection confirmed working
  • ✅ SSL weak cipher detection confirmed working
  • ✅ Port scanning executed correctly (1005 requests)
  • ✅ Report generation successful
  • ✅ Zero Python 3.12 compatibility errors

Related PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions