Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 9cdb42ce66b6c43838cb122996f2525bf195c324 Mon Sep 17 00:00:00 2001
- From: jd-street <jd-street@not.available>
- Date: Sat, 15 Apr 2017 20:19:56 +0900
- Subject: [PATCH 4/4] support HTTPS access to 2ch-like sites via proxy.
- Don't use SSL between JD and a proxy to access those sites,
- though proxy can still use SSL to connect to the origin server.
- This hacky patch is needed if destination sites require HTTPS access
- and HTTPS tunneling is not an option because some processing at proxy
- (like authorization cookie management or content scraping) is necessary.
- Currently, 2ch-like sites neither require HTTPS nor reject HTTP.
- Futhermore, the bbsmenu list contains no HTTPS url,
- which makes JD always use HTTP to access those sites
- (regardless of the URI scheme in <a> links).
- So this is a prep work for the possible future
- where 2ch mandates HTTPS access and/or bbsmenu contains HTTPS URLs.
- Signed-off-by: jd-street <jd-street@not.available>
- ---
- src/jdlib/loader.cpp | 12 ++++++++----
- 1 file changed, 8 insertions(+), 4 deletions(-)
- diff --git a/src/jdlib/loader.cpp b/src/jdlib/loader.cpp
- index 7ad1154..aed784e 100644
- --- a/src/jdlib/loader.cpp
- +++ b/src/jdlib/loader.cpp
- @@ -446,8 +446,6 @@ bool Loader::run( SKELETON::Loadable* cb, const LOADERDATA& data_in )
- // https
- else if( m_data.protocol.find( "https://" ) != std::string::npos ){
- - m_data.use_ssl = true;
- - m_data.async = false;
- m_data.port = 443;
- }
- @@ -461,8 +459,14 @@ bool Loader::run( SKELETON::Loadable* cb, const LOADERDATA& data_in )
- }
- }
- - // 明示的にssl使用指定
- - if( data_in.use_ssl ){
- + // ssl使用指定
- + // HACK: don't use SSL to access 2ch via a scraping proxy
- + if( data_in.use_ssl
- + || ( m_data.protocol.find( "https://" ) != std::string::npos
- + && m_data.host.find( ".2ch.net" ) == std::string::npos
- + && m_data.host.find( ".bbspink.com" ) == std::string::npos
- + )
- + ){
- m_data.use_ssl = true;
- m_data.async = false;
- }
- --
- 2.12.2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement