Skip to content

🐛 BUG: Error: Origin SSL Handshake Error (525) when making requests to deepl API #776

@Zombobot1

Description

@Zombobot1

Which Cloudflare product(s) does this pertain to?

Workers/Other

What version of Wrangler are you using?

3.1.0

What operating system are you using?

Mac

Describe the Bug

It is impossible to query deepl API from workers.

The bug was first mentioned in August 2021 on the forum. It was stated that "this is typically caused by a configuration issue in the origin web server". I opened a corresponding issue in their repo and they concluded that "the problem lies with cloudflare workers". Can you take a look at this problem? Other services might be unreachable as well.

Deepl is a very popular product and it is sad that it can be used with workers.

Code to reproduce

const deepLUrl = 'https://api-free.deepl.com/v2/translate'
const text = 'I like my cat'
const to = 'de'
const from = 'en'

const resp = await fetch(deepLUrl, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
    Authorization: `DeepL-Auth-Key ${env.DEEPL}`,
  },
  body: `text=${encodeURIComponent(text)}&target_lang=${to.toUpperCase()}&source_lang=${from.toUpperCase()}`,
})
if (!resp.ok) throw new Error(`DeepL error (${resp.status}) ` + resp.statusText) // throws in workers
const response = await resp.json()
response.translations[0].text // works in node

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions