goproxy
goproxy copied to clipboard
MITM: recreating private/public keys all the time
... has huge impact on speed of processing, with this change the RSA and ECDSA keys are created within "init()" and used when needed. This is quick fix, please set it to some configuration variable if you consider that it is useful to generate them on each request. I dont think this would impact the security on client side.
@stiray @elazarl @engineering-this : see https://github.com/hazcod/goproxy/commit/152f8657271878d3f574290108e33e2d6b70c348 and https://github.com/hazcod/goproxy/commit/578522f2b72d45129809fc62426982266b72f7f2 for a possibly better implementation.
Ok, I am not using github and I dont even intend to as I have my own git server and I am quite happy with shell so I wont be clicking anything here any more...
Regarding the "race condition" which was probably merged due to clicking to "resolve whatever" which was a mistake if "the semaphore fix" came into code.
The race condition was put there deliberately to avoid synchronizing multiple threads using synchronization object at a cost that here and then the certificate is generated without any reason which is performance wise better decision.
But nvm me, this was a drive by code, it have my own git server/repo/fork (ignore the one that is on github, wont be updated any more) so please do whatever feels appropriate for you.