Skip to content

[Help]SSLEOFError(8, 'EOF occurred in violation of protoc ol (_ssl.c:1129)')) #11496

@Suz1e

Description

@Suz1e

What would you like to share?

Subject

My script is a BOT script that calls PUBG's open api for data query Now I have a problem

HTTPSConnectionPool(host='api.pubg.com', port=443):
Max retries exceeded with url: /shards/steam/players?filter%5BplayerNames%5D=Dai
lyMidv_x (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protoc
ol (_ssl.c:1129)')))

Environment

Describe your environment.
At least, paste here the output of:

C:\Users\Administrator\AppData\Local\Programs\Python\Python39\python.exe
OS Windows-2012ServerR2-6.3.9600-SP0
Python 3.9.13
OpenSSL 1.1.1n  15 Mar 2022
urllib3 1.25.11

Steps to Reproduce

This problem occurs occasionally and does not occur frequently The SSL certificate used by my vps is the free SSL certificate applied by Tencent Cloud This is my script code
my vps is not using a proxy, VPN, etc.

def get_player_data(player_id):
    url = f"https://api.pubg.com/shards/steam/players?filter[playerNames]={player_id}"
    try:
        response = requests.get(url, headers=headers)
    except requests.exceptions.RequestException as e:
        print(f"error:{e}")
        sys.exit(3)
    if response.status_code in 429:
        sys.exit(2)
    elif response.status_code in [400, 404]:
        sys.exit(1)
    else:
        data = response.json()
        ban_type = data['data'][0]['attributes']['banType'] if 'data' in data and data['data'] else None
        account_id = data['data'][0]['id'] if 'data' in data and data['data'] else None
        return data, ban_type, account_id

Expected Behavior

You should access the API normally and get the data to make a picture

Actual Behavior

What happens instead.
Returns an SSL error and closes the script

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting triageAwaiting triage from a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions