Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patroneos with https - simple mode #51

Open
gitggooss opened this issue Dec 19, 2019 · 1 comment
Open

patroneos with https - simple mode #51

gitggooss opened this issue Dec 19, 2019 · 1 comment

Comments

@gitggooss
Copy link

gitggooss commented Dec 19, 2019

Patroneos is a great tool to protect API from a malformed json query and it works perfect under HTTP protocol on an eosio node:

curl http://mydomain.com:8887/v1/chain/get_code -X POST -d '{c}' | json_pp

OUTPUT:

{
   "code" : 400,
   "message" : "INVALID_JSON"
}

Simply perfect!!!

The problem I get is with HTTPS.
Under HTTPS protocol, unfortunately, I get some error; here the config.json for patroneos on HTTPS:

{
    "listenIP": "0.0.0.0",
    "configListenPort": "9000",
    "listenPort": "8889",

    "nodeosProtocol": "https",
    "nodeosUrl": "mydomain.com",
    "nodeosPort": "8888",

    "contractBlackList": {
        "currency": true
    },
    "maxSignatures": 10,
    "maxTransactionSize": 1000000,
    "maxTransactions": 32,
    "headers": {
        "Sample-Header": "value"
    }
}

When I try to send an malformed json query, the connection is with TLSv1.3, but the given message is not the expected "invalid json" but a general system error:

curl -vvv https://mydomain.com:8889/v1/chain/get_code -X POST -d '{c}' | json_pp

OUTPUT:

..
....
* Closing connection 0
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number

Is
"nodeosProtocol": "https"
in config.json allowed to work?

Thanks.
Giuseppe

@jeffreyssmith2nd
Copy link
Contributor

Glad to hear Patroneos is working well for you.

Currently, it does not have support for handling SSL. If you need to handle SSL, you can run a reverse proxy, such as NGINX or HaProxy, in front of Patroneos and terminate SSL before proxying to Patroneos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants