argosopentech / argos-translate

Open-source offline translation library written in Python
https://www.argosopentech.com
MIT License
3.94k stars 287 forks source link

ssl.SSLError: [SSL: TLSV1_UNRECOGNIZED_NAME] tlsv1 unrecognized name (_ssl.c:1091) #381

Open kishoreyakkanti opened 11 months ago

kishoreyakkanti commented 11 months ago

Hi,

Function to translate using argostranslate

def trans_argos(text): url = "https://translate.argosopentech.com/translate"

payload = { "q": text, "source": "auto", "target": "en" } headers = { "Content-Type": "application/json" }

response = requests.post(url, data=json.dumps(payload), headers=headers)

return response.json()['translatedText']

When i am using this URL I am facing the following error requests.exceptions.SSLError: HTTPSConnectionPool(host='translate.argosopentech.com', port=443): Max retries exceeded with url: /translate (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)')))

Please help.

Thanks

sohang3112 commented 10 months ago

https://translate.argosopentech.com/ site seems to have some SSL/TLS misconfiguration which is causing this issue. @PJ-Finlay can you check the issue with the website?

$ curl https://translate.argosopentech.com/
schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed).
PJ-Finlay commented 10 months ago

I'm guessing this is an issue with the Cloudfate links here: https://github.com/argosopentech/argos-train/blob/master/data-index.json

sohang3112 commented 10 months ago

@PJ-Finlay Can you please clarify what are "Cloudfate links"? I searched this repo, but I couldn't find the word "Cloudfate" anywhere. The links in https://github.com/argosopentech/argos-train/blob/master/data-index.json pointed to various .argosdata files in https://data.argosopentech.com/ , but that doesn't seem to have anything called "Cloudfate".

sohang3112 commented 10 months ago

I'm guessing this is an issue with the Cloudfate links here: https://github.com/argosopentech/argos-train/blob/master/data-index.json

@PJ-Finlay please clarify what Cloudfate links you're talking about, and how they relate to the SSL error in the website https://translate.argosopentech.com/

pierotofy commented 10 months ago

Try hosting your own instance: https://github.com/LibreTranslate/LibreTranslate