alibaba / alibaba/anyproxy

Error 'key too small'

Open
#521 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

#### Which platform are you running AnyProxy
Linux

#### The version of the AnyProxy
4.1.0 with Node.js 10.16.3

#### Your expected behavior of AnyProxy
Intercepting https traffic works.

#### The actual behavior of AnyProxy
An error appears in the log. Https requests time out.

#### The log of the error
```
anyproxy --intercept
Error: error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small
at Object.createSecureContext (_tls_common.js:135:17)
at Server (_tls_wrap.js:873:27)
at new Server (https.js:62:14)
at Object.createServer (https.js:85:10)
at /usr/lib/node_modules/anyproxy/node_modules/node-easy-cert/dist/index.js:189:30
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
[AnyProxy Log][2019-09-26 10:38:34]: Http proxy started on port 8001
[AnyProxy Log][2019-09-26 10:38:34]: web interface started on port 8002
```

#### The cause
It may be related to the updated openssl version of Node 10.
I expect that the solution is to make sure that the certificate which is generated via `anyproxy-ca -g` uses a key which is long enough.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the `anyproxy-ca -g` entry point and inspect the certificate-generation path implicated by `node-easy-cert/dist/index.js:189`, then compare it with Node.js 10's `createSecureContext` error. Done means the generated certificate uses an accepted key size and `anyproxy --intercept` can handle HTTPS requests without timeouts.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
networking, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.