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

getrandom() initialization failed if run on boot #2013

Closed
laurentdinclaux opened this issue Feb 12, 2017 · 2 comments
Closed

getrandom() initialization failed if run on boot #2013

laurentdinclaux opened this issue Feb 12, 2017 · 2 comments

Comments

@laurentdinclaux
Copy link

laurentdinclaux commented Feb 12, 2017

Steps to reproduce the problem:

I created a systemd startup file:

[Unit]
Description=Mitmproxy
After=network.target

[Service]
#Type=simple
Type=idle
EnvironmentFile=/etc/default/mitmproxy
User=mitmproxy
Group=mitmproxy
LimitNOFILE=32768
ExecStart=/usr/local/bin/mitmdump $DAEMON_ARGS --conf=$CONFFILE --cadir=/etc/mitmproxy

[Install]
WantedBy=multi-user.target

Whenever I reboot my ubuntu 16.04 VM, mitmdump runs, but throw error for SSL websites:

Cannot establish TLS with 216.58.204.104:443 (sni: ssl.google-analytics.com): TlsException("SSL handshake error: Error([('', 'osrandom_rand_bytes', 'getrandom() initialization failed.')],)",)

If I log into ssh and restart the service manually it then runs fine.

System information

Ubuntu 16.04 - mitmproxy 1.0.2

@Kriechi
Copy link
Member

Kriechi commented Feb 12, 2017

This is more a general Python issue and unfortunately not directly related to mitmproxy.
Fur further information please see:
https://lwn.net/Articles/693189/
https://bugs.python.org/issue26839

You could try and experiment with systemd-random-seed.service in your service definition...

@Kriechi Kriechi closed this as completed Feb 12, 2017
@nesttle
Copy link

nesttle commented Feb 27, 2017

Same here,
https://discourse.mitmproxy.org/t/run-mitmdump-from-crontab-solved/373/4

I try with:
@reboot sleep 60 && script.sh

Still not working (didn't happen on mitm0.18, but 2.0)

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

3 participants