Created
December 14, 2018 23:33
-
-
Save yutannihilation/c11b130f6ecd8c6d5f488ede5c5507f9 to your computer and use it in GitHub Desktop.
Use mitmproxy with R (not working yet)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmp <- file.path(normalizePath(tempdir()), "certs") | |
dir.create(tmp) | |
download.file("https://curl.haxx.se/ca/cacert.pem", file.path(tmp, "cacert-mozilla.pem"), mode = "wb") | |
library(httr) | |
proxy_conf <- use_proxy("http://127.0.0.1", port = 8080) | |
res <- GET("http://mitm.it/cert/pem", config = proxy_conf) | |
writeBin(content(res), file.path(tmp, "cacert-mitm.pem")) | |
conf <- c(proxy_conf, config(cainfo = tmp), verbose()) | |
GET("https://example.com", config = conf) | |
list.files(tmp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment