WebKit Bugzilla
Attachment 356565 Details for
Bug 192374
: Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
c-backup.diff (text/plain), 7.67 KB, created by
Saam Barati
on 2018-12-04 18:09:19 PST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Saam Barati
Created:
2018-12-04 18:09:19 PST
Size:
7.67 KB
patch
obsolete
>Index: Source/WebCore/PAL/ChangeLog >=================================================================== >--- Source/WebCore/PAL/ChangeLog (revision 238882) >+++ Source/WebCore/PAL/ChangeLog (working copy) >@@ -1,3 +1,12 @@ >+2018-12-04 Saam Barati <sbarati@apple.com> >+ >+ Enable HTTP and HTTPS proxies on iOS >+ https://bugs.webkit.org/show_bug.cgi?id=192374 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * pal/spi/cf/CFNetworkSPI.h: >+ > 2018-12-02 Zalan Bujtas <zalan@apple.com> > > Add a runtime feature flag for LayoutFormattingContext. >Index: Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h >=================================================================== >--- Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h (revision 238871) >+++ Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h (working copy) >@@ -33,6 +33,7 @@ > #if PLATFORM(WIN) || USE(APPLE_INTERNAL_SDK) > > #include <CFNetwork/CFHTTPCookiesPriv.h> >+#include <CFNetwork/CFHTTPStream.h> > #include <CFNetwork/CFProxySupportPriv.h> > #include <CFNetwork/CFURLCachePriv.h> > #include <CFNetwork/CFURLConnectionPriv.h> >Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 238871) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,21 @@ >+2018-12-04 Saam Barati <sbarati@apple.com> >+ >+ Enable HTTP and HTTPS proxies on iOS >+ https://bugs.webkit.org/show_bug.cgi?id=192374 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ To turn this on on an iOS device, you can run this on device: >+ $ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080" >+ $ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080" >+ >+ * NetworkProcess/cocoa/NetworkProcessCocoa.mm: >+ (WebKit::overrideSystemProxies): >+ (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): >+ * NetworkProcess/mac/NetworkProcessMac.mm: >+ (WebKit::NetworkProcess::platformInitializeNetworkProcess): >+ (WebKit::overrideSystemProxies): Deleted. >+ > 2018-12-04 Chris Dumez <cdumez@apple.com> > > Regression(r238817) PSON Page Cache API tests are failing >Index: Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >=================================================================== >--- Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (revision 238871) >+++ Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (working copy) >@@ -35,6 +35,7 @@ > #import "NetworkSessionCocoa.h" > #import "SandboxExtension.h" > #import "SessionTracker.h" >+#import "StringUtilities.h" > #import <WebCore/NetworkStorageSession.h> > #import <WebCore/PublicSuffix.h> > #import <WebCore/ResourceRequestCFNet.h> >@@ -69,6 +70,43 @@ static void initializeNetworkSettings() > } > } > >+static void overrideSystemProxies(const String& httpProxy, const String& httpsProxy) >+{ >+#pragma clang diagnostic push >+#pragma clang diagnostic ignored "-Wdeprecated-declarations" >+ NSMutableDictionary *proxySettings = [NSMutableDictionary dictionary]; >+ >+ if (!httpProxy.isNull()) { >+ URL httpProxyURL(URL(), httpProxy); >+ if (httpProxyURL.isValid()) { >+ [proxySettings setObject:nsStringFromWebCoreString(httpProxyURL.host().toString()) forKey:(NSString *)kCFStreamPropertyHTTPProxyHost]; >+ if (httpProxyURL.port()) { >+ NSNumber *port = [NSNumber numberWithInt:httpProxyURL.port().value()]; >+ [proxySettings setObject:port forKey:(NSString *)kCFStreamPropertyHTTPProxyPort]; >+ } >+ } else >+ NSLog(@"Malformed HTTP Proxy URL '%s'. Expected 'http://<hostname>[:<port>]'\n", httpProxy.utf8().data()); >+ } >+ >+ if (!httpsProxy.isNull()) { >+ URL httpsProxyURL(URL(), httpsProxy); >+ if (httpsProxyURL.isValid()) { >+#if !PLATFORM(IOSMAC) >+ [proxySettings setObject:nsStringFromWebCoreString(httpsProxyURL.host().toString()) forKey:(NSString *)kCFStreamPropertyHTTPSProxyHost]; >+ if (httpsProxyURL.port()) { >+ NSNumber *port = [NSNumber numberWithInt:httpsProxyURL.port().value()]; >+ [proxySettings setObject:port forKey:(NSString *)kCFStreamPropertyHTTPSProxyPort]; >+ } >+#endif >+ } else >+ NSLog(@"Malformed HTTPS Proxy URL '%s'. Expected 'https://<hostname>[:<port>]'\n", httpsProxy.utf8().data()); >+ } >+ >+ if ([proxySettings count] > 0) >+ _CFNetworkSetOverrideSystemProxySettings((__bridge CFDictionaryRef)proxySettings); >+#pragma clang diagnostic pop >+} >+ > void NetworkProcess::platformInitializeNetworkProcessCocoa(const NetworkProcessCreationParameters& parameters) > { > WebCore::setApplicationBundleIdentifier(parameters.uiProcessBundleIdentifier); >@@ -132,6 +170,9 @@ void NetworkProcess::platformInitializeN > // Disable NSURLCache. > auto urlCache(adoptNS([[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil])); > [NSURLCache setSharedURLCache:urlCache.get()]; >+ >+ if (!parameters.httpProxy.isNull() || !parameters.httpsProxy.isNull()) >+ overrideSystemProxies(parameters.httpProxy, parameters.httpsProxy); > } > > RetainPtr<CFDataRef> NetworkProcess::sourceApplicationAuditData() const >Index: Source/WebKit/NetworkProcess/mac/NetworkProcessMac.mm >=================================================================== >--- Source/WebKit/NetworkProcess/mac/NetworkProcessMac.mm (revision 238871) >+++ Source/WebKit/NetworkProcess/mac/NetworkProcessMac.mm (working copy) >@@ -65,41 +65,6 @@ void NetworkProcess::initializeProcessNa > #endif > } > >-static void overrideSystemProxies(const String& httpProxy, const String& httpsProxy) >-{ >- NSMutableDictionary *proxySettings = [NSMutableDictionary dictionary]; >- >- if (!httpProxy.isNull()) { >- URL httpProxyURL(URL(), httpProxy); >- if (httpProxyURL.isValid()) { >- [proxySettings setObject:nsStringFromWebCoreString(httpProxyURL.host().toString()) forKey:(NSString *)kCFNetworkProxiesHTTPProxy]; >- if (httpProxyURL.port()) { >- NSNumber *port = [NSNumber numberWithInt:httpProxyURL.port().value()]; >- [proxySettings setObject:port forKey:(NSString *)kCFNetworkProxiesHTTPPort]; >- } >- } >- else >- NSLog(@"Malformed HTTP Proxy URL '%s'. Expected 'http://<hostname>[:<port>]'\n", httpProxy.utf8().data()); >- } >- >- if (!httpsProxy.isNull()) { >- URL httpsProxyURL(URL(), httpsProxy); >- if (httpsProxyURL.isValid()) { >-#if !PLATFORM(IOSMAC) >- [proxySettings setObject:nsStringFromWebCoreString(httpsProxyURL.host().toString()) forKey:(NSString *)kCFNetworkProxiesHTTPSProxy]; >- if (httpsProxyURL.port()) { >- NSNumber *port = [NSNumber numberWithInt:httpsProxyURL.port().value()]; >- [proxySettings setObject:port forKey:(NSString *)kCFNetworkProxiesHTTPSPort]; >- } >-#endif >- } else >- NSLog(@"Malformed HTTPS Proxy URL '%s'. Expected 'https://<hostname>[:<port>]'\n", httpsProxy.utf8().data()); >- } >- >- if ([proxySettings count] > 0) >- _CFNetworkSetOverrideSystemProxySettings((__bridge CFDictionaryRef)proxySettings); >-} >- > void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreationParameters& parameters) > { > platformInitializeNetworkProcessCocoa(parameters); >@@ -108,9 +73,6 @@ void NetworkProcess::platformInitializeN > // SecItemShim is needed for CFNetwork APIs that query Keychains beneath us. > initializeSecItemShim(*this); > #endif >- >- if (!parameters.httpProxy.isNull() || !parameters.httpsProxy.isNull()) >- overrideSystemProxies(parameters.httpProxy, parameters.httpsProxy); > } > > void NetworkProcess::allowSpecificHTTPSCertificateForHost(const CertificateInfo& certificateInfo, const String& host)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192374
:
356565
|
356583
|
356586
|
356623
|
356712
|
356713
|
356714
|
356739
|
356931
|
357506