WebKit Bugzilla
Attachment 357511 Details for
Bug 191539
: Web Inspector: Network: show secure connection details per-request
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-191539-20181217181009.patch (text/plain), 48.05 KB, created by
Devin Rousso
on 2018-12-17 18:10:10 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2018-12-17 18:10:10 PST
Size:
48.05 KB
patch
obsolete
>diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 818ab2e41ae37ecab67181ca15124e40337945ee..5a83d110cdae10c209055c34e7a129ae96040eec 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-12-17 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Network: show secure connection details per-request >+ https://bugs.webkit.org/show_bug.cgi?id=191539 >+ <rdar://problem/45979891> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/protocol/Security.json: >+ Add `Connection` type. >+ >+ * inspector/protocol/Network.json: >+ Send `Security.Connection` information when request metrics become available. >+ > 2018-12-15 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > Unreviewed, suppress warnings in Linux >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 05949be24b6755555509935ddeb5f9f31f963327..b5850addf2a1dfd8f47b7f87e9503fb3a7dbf926 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-12-17 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Network: show secure connection details per-request >+ https://bugs.webkit.org/show_bug.cgi?id=191539 >+ <rdar://problem/45979891> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: http/tests/inspector/network/resource-security-connection.html >+ >+ * platform/network/NetworkLoadMetrics.h: >+ (WebCore::NetworkLoadMetrics:isolatedCopy): >+ (WebCore::NetworkLoadMetrics:clearNonTimingData): >+ (WebCore::NetworkLoadMetrics:operator==): >+ (WebCore::NetworkLoadMetrics:encode): >+ (WebCore::NetworkLoadMetrics:decode): >+ >+ * inspector/agents/InspectorNetworkAgent.cpp: >+ (WebCore::InspectorNetworkAgent::buildObjectForMetrics): >+ > 2018-12-15 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > Null pointer dereference in JSC::WriteBarrierBase() >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index d975a1638e1e83e69455a52886e9664862e7083a..4b3a4a922111768888d8306383ea3a9355f4c7b8 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,13 @@ >+2018-12-17 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Network: show secure connection details per-request >+ https://bugs.webkit.org/show_bug.cgi?id=191539 >+ <rdar://problem/45979891> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * pal/spi/cf/CFNetworkSPI.h: >+ > 2018-12-15 Darin Adler <darin@apple.com> > > Use warning-ignoring macros more consistently and simply >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 9152ad45a76b7b16c7970000dfa89f9f834c0cdf..fa5722b2c17f163fecd34b2d7578c0651d616bb0 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,33 @@ >+2018-12-17 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Network: show secure connection details per-request >+ https://bugs.webkit.org/show_bug.cgi?id=191539 >+ <rdar://problem/45979891> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Models/Resource.js: >+ (WI.Resource): >+ (WI.Resource.prototype.get security): Added. >+ (WI.Resource.prototype.updateForResponse): >+ (WI.Resource.prototype.updateWithMetrics): >+ (WI.Resource.prototype.get responseSecurity): Deleted. >+ >+ * UserInterface/Views/ResourceSecurityContentView.js: >+ (WI.ResourceSecurityContentView): >+ (WI.ResourceSecurityContentView.prototype.initialLayout): >+ (WI.ResourceSecurityContentView.prototype.layout): >+ (WI.ResourceSecurityContentView.prototype._refreshConnectionSection): Added. >+ (WI.ResourceSecurityContentView.prototype._refreshCetificateSection): >+ (WI.ResourceSecurityContentView.prototype._handleResourceMetricsDidChange): Added. >+ * UserInterface/Views/ResourceSecurityContentView.css: >+ (body[dir] .resource-security > section:matches(.connection, .certificate) > .details): Added. >+ (@media (prefers-dark-interface) body[dir] .resource-security > section:matches(.connection, .certificate) > .details): Added. >+ (body[dir] .resource-security > section.certificate > .details): Deleted. >+ (@media (prefers-dark-interface) body[dir] .resource-security > section.certificate > .details): Deleted. >+ >+ * Localizations/en.lproj/localizedStrings.js: >+ > 2018-12-15 Nikita Vasilyev <nvasilyev@apple.com> > > Web Inspector: Styles: toggling selected properties may cause data corruption >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 71e152e10e7435374bb5b5977d437e6db79a62a3..f2f075a793fb33803b1ca59ed73b003281fa384d 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2018-12-17 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Network: show secure connection details per-request >+ https://bugs.webkit.org/show_bug.cgi?id=191539 >+ <rdar://problem/45979891> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm: >+ (stringForSSLProtocol): Added. >+ (stringForSSLCipher): Added. >+ (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): >+ > 2018-12-16 Chris Fleizach <cfleizach@apple.com> > > AX: Support keyboard access preference for iOS in WebKit >diff --git a/Source/JavaScriptCore/inspector/protocol/Network.json b/Source/JavaScriptCore/inspector/protocol/Network.json >index 338d74566607339717577018fb9139238db2b891..1ed44713f615ba0737c9954af6717443163ddadb 100644 >--- a/Source/JavaScriptCore/inspector/protocol/Network.json >+++ b/Source/JavaScriptCore/inspector/protocol/Network.json >@@ -93,7 +93,8 @@ > { "name": "requestBodyBytesSent", "type": "number", "optional": true, "description": "Total HTTP request body bytes sent over the network." }, > { "name": "responseHeaderBytesReceived", "type": "number", "optional": true, "description": "Total HTTP response header bytes received over the network." }, > { "name": "responseBodyBytesReceived", "type": "number", "optional": true, "description": "Total HTTP response body bytes received over the network." }, >- { "name": "responseBodyDecodedSize", "type": "number", "optional": true, "description": "Total decoded response body size in bytes." } >+ { "name": "responseBodyDecodedSize", "type": "number", "optional": true, "description": "Total decoded response body size in bytes." }, >+ { "name": "securityConnection", "$ref": "Security.Connection", "optional": true, "description": "Connection information for the completed request." } > ] > }, > { >diff --git a/Source/JavaScriptCore/inspector/protocol/Security.json b/Source/JavaScriptCore/inspector/protocol/Security.json >index 4794aafc01307bac44ee617ca647e9deda7c01f2..4c16135fc17847b1e49af2c1c8cc00b7b8505554 100644 >--- a/Source/JavaScriptCore/inspector/protocol/Security.json >+++ b/Source/JavaScriptCore/inspector/protocol/Security.json >@@ -2,6 +2,15 @@ > "domain": "Security", > "description": "Security domain allows the frontend to query for information relating to the security of the page (e.g. HTTPS info, TLS info, user activity, etc.).", > "types": [ >+ { >+ "id": "Connection", >+ "type": "object", >+ "description": "Information about a SSL connection to display in the frontend.", >+ "properties": [ >+ { "name": "protocol", "type": "string", "optional": true }, >+ { "name": "cipher", "type": "string", "optional": true } >+ ] >+ }, > { > "id": "Certificate", > "type": "object", >@@ -19,6 +28,7 @@ > "type": "object", > "description": "Security information for a given Network.Response.", > "properties": [ >+ { "name": "connection", "$ref": "Connection", "optional": true }, > { "name": "certificate", "$ref": "Certificate", "optional": true } > ] > } >diff --git a/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h b/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h >index 876b1eaa6d746586930acf06071ec463f0dfa24a..f178f5ccf0949f1a71485c4df208a097b7da08f0 100644 >--- a/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h >+++ b/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h >@@ -211,6 +211,13 @@ typedef NS_ENUM(NSInteger, NSURLSessionCompanionProxyPreference) { > @end > #endif > >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) >+@interface NSURLSessionTaskTransactionMetrics () >+@property (assign) SSLProtocol _negotiatedTLSProtocol; >+@property (assign) SSLCipherSuite _negotiatedTLSCipher; >+@end >+#endif >+ > extern NSString * const NSURLAuthenticationMethodOAuth; > > #endif // defined(__OBJC__) >diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp >index 2230993d232ddd55472e6d9c8185100e885059b8..4bfef418ad482a853edfbcc66780b2686a7a63b0 100644 >--- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp >@@ -264,6 +264,17 @@ Ref<Inspector::Protocol::Network::Metrics> InspectorNetworkAgent::buildObjectFor > if (networkLoadMetrics.responseBodyDecodedSize != std::numeric_limits<uint64_t>::max()) > metrics->setResponseBodyDecodedSize(networkLoadMetrics.responseBodyDecodedSize); > >+ auto connectionPayload = Inspector::Protocol::Security::Connection::create() >+ .release(); >+ >+ if (!networkLoadMetrics.tlsProtocol.isEmpty()) >+ connectionPayload->setProtocol(networkLoadMetrics.tlsProtocol); >+ >+ if (!networkLoadMetrics.tlsCipher.isEmpty()) >+ connectionPayload->setCipher(networkLoadMetrics.tlsCipher); >+ >+ metrics->setSecurityConnection(WTFMove(connectionPayload)); >+ > return metrics; > } > >diff --git a/Source/WebCore/platform/network/NetworkLoadMetrics.h b/Source/WebCore/platform/network/NetworkLoadMetrics.h >index 05d660a33c14557b569e89e97d00b9f8af6e593e..59fdc6b5ed03f4c57916c3975d4839b7555343b0 100644 >--- a/Source/WebCore/platform/network/NetworkLoadMetrics.h >+++ b/Source/WebCore/platform/network/NetworkLoadMetrics.h >@@ -71,6 +71,8 @@ public: > copy.remoteAddress = remoteAddress.isolatedCopy(); > copy.connectionIdentifier = connectionIdentifier.isolatedCopy(); > copy.priority = priority; >+ copy.tlsProtocol = tlsProtocol.isolatedCopy(); >+ copy.tlsCipher = tlsCipher.isolatedCopy(); > copy.requestHeaders = requestHeaders.isolatedCopy(); > > copy.requestHeaderBytesSent = requestHeaderBytesSent; >@@ -102,6 +104,8 @@ public: > remoteAddress = String(); > connectionIdentifier = String(); > priority = NetworkLoadPriority::Unknown; >+ tlsProtocol = String(); >+ tlsCipher = String(); > requestHeaders.clear(); > requestHeaderBytesSent = std::numeric_limits<uint32_t>::max(); > requestBodyBytesSent = std::numeric_limits<uint64_t>::max(); >@@ -125,6 +129,8 @@ public: > && remoteAddress == other.remoteAddress > && connectionIdentifier == other.connectionIdentifier > && priority == other.priority >+ && tlsProtocol == other.tlsProtocol >+ && tlsCipher == other.tlsCipher > && requestHeaders == other.requestHeaders > && requestHeaderBytesSent == other.requestHeaderBytesSent > && requestBodyBytesSent == other.requestBodyBytesSent >@@ -162,6 +168,9 @@ public: > String connectionIdentifier; > NetworkLoadPriority priority; > >+ String tlsProtocol; >+ String tlsCipher; >+ > // Whether or not all of the properties (0 or otherwise) have been set. > bool complete { false }; > >@@ -198,6 +207,8 @@ void NetworkLoadMetrics::encode(Encoder& encoder) const > encoder << remoteAddress; > encoder << connectionIdentifier; > encoder << priority; >+ encoder << tlsProtocol; >+ encoder << tlsCipher; > encoder << requestHeaders; > encoder << requestHeaderBytesSent; > encoder << requestBodyBytesSent; >@@ -222,6 +233,8 @@ bool NetworkLoadMetrics::decode(Decoder& decoder, NetworkLoadMetrics& metrics) > && decoder.decode(metrics.remoteAddress) > && decoder.decode(metrics.connectionIdentifier) > && decoder.decode(metrics.priority) >+ && decoder.decode(metrics.tlsProtocol) >+ && decoder.decode(metrics.tlsCipher) > && decoder.decode(metrics.requestHeaders) > && decoder.decode(metrics.requestHeaderBytesSent) > && decoder.decode(metrics.requestBodyBytesSent) >diff --git a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >index 0d1dba8a59daa7756ec278f99be8e01629e0f550..cde091401302046e8a81580decf70958dd5195d0 100644 >--- a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >+++ b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >@@ -185,6 +185,7 @@ localizedStrings["Child"] = "Child"; > localizedStrings["Child Layers"] = "Child Layers"; > localizedStrings["Child added to "] = "Child added to "; > localizedStrings["Children"] = "Children"; >+localizedStrings["Cipher"] = "Cipher"; > localizedStrings["Classes"] = "Classes"; > localizedStrings["Clear Filters"] = "Clear Filters"; > localizedStrings["Clear Log"] = "Clear Log"; >@@ -613,6 +614,8 @@ localizedStrings["No Results Found"] = "No Results Found"; > localizedStrings["No Search Results"] = "No Search Results"; > localizedStrings["No Watch Expressions"] = "No Watch Expressions"; > localizedStrings["No audit selected"] = "No audit selected"; >+localizedStrings["No certificate security information."] = "No certificate security information."; >+localizedStrings["No connection security information."] = "No connection security information."; > localizedStrings["No matching ARIA role"] = "No matching ARIA role"; > localizedStrings["No preview available"] = "No preview available"; > localizedStrings["No request cookies."] = "No request cookies."; >@@ -621,8 +624,6 @@ localizedStrings["No request, served from the disk cache."] = "No request, serve > localizedStrings["No request, served from the memory cache."] = "No request, served from the memory cache."; > localizedStrings["No response cookies."] = "No response cookies."; > localizedStrings["No response headers"] = "No response headers"; >-localizedStrings["No response security certificate."] = "No response security certificate."; >-localizedStrings["No response security information."] = "No response security information."; > localizedStrings["Node"] = "Node"; > localizedStrings["Node Removed"] = "Node Removed"; > localizedStrings["Nodes"] = "Nodes"; >diff --git a/Source/WebInspectorUI/UserInterface/Models/Resource.js b/Source/WebInspectorUI/UserInterface/Models/Resource.js >index a0a9beb5e64fb05a3bb1e6632d712fee1ad3df9d..a1de9f1fe17cee8649227480202847cc9fd34a5c 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/Resource.js >+++ b/Source/WebInspectorUI/UserInterface/Models/Resource.js >@@ -70,7 +70,7 @@ WI.Resource = class Resource extends WI.SourceCode > this._failureReasonText = null; > this._receivedNetworkLoadMetrics = false; > this._responseSource = WI.Resource.ResponseSource.Unknown; >- this._responseSecurity = null; >+ this._security = null; > this._timingData = new WI.ResourceTimingData(this); > this._protocol = null; > this._priority = WI.Resource.NetworkPriority.Unknown; >@@ -307,7 +307,7 @@ WI.Resource = class Resource extends WI.SourceCode > get statusCode() { return this._statusCode; } > get statusText() { return this._statusText; } > get responseSource() { return this._responseSource; } >- get responseSecurity() { return this._responseSecurity; } >+ get security() { return this._security; } > get timingData() { return this._timingData; } > get protocol() { return this._protocol; } > get priority() { return this._priority; } >@@ -716,7 +716,7 @@ WI.Resource = class Resource extends WI.SourceCode > this._responseSource = WI.Resource.responseSourceFromPayload(source); > > if (security) >- this._responseSecurity = security; >+ this._security = security; > > const headerBaseSize = 12; // Length of "HTTP/1.1 ", " ", and "\r\n". > const headerPad = 4; // Length of ": " and "\r\n". >@@ -793,6 +793,9 @@ WI.Resource = class Resource extends WI.SourceCode > this.dispatchEventToListeners(WI.Resource.Event.TransferSizeDidChange); > } > >+ if (metrics.securityConnection) >+ this._security.connection = metrics.securityConnection; >+ > this.dispatchEventToListeners(WI.Resource.Event.MetricsDidChange); > } > >diff --git a/Source/WebInspectorUI/UserInterface/Views/ResourceSecurityContentView.css b/Source/WebInspectorUI/UserInterface/Views/ResourceSecurityContentView.css >index 2f0015b608a376a0b0ed9c431f15ed26a290c9d3..d1597672a78792de0a39b607f5f102d01a2c4883 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ResourceSecurityContentView.css >+++ b/Source/WebInspectorUI/UserInterface/Views/ResourceSecurityContentView.css >@@ -23,7 +23,7 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-body[dir] .resource-security > section.certificate > .details { >+body[dir] .resource-security > section:matches(.connection, .certificate) > .details { > border-color: var(--network-dns-color); > } > >@@ -54,7 +54,7 @@ body[dir] .resource-security > section.certificate > .details { > } > > @media (prefers-dark-interface) { >- body[dir] .resource-security > section.certificate > .details { >+ body[dir] .resource-security > section:matches(.connection, .certificate) > .details { > border-color: var(--network-pseudo-header-color); > } > >diff --git a/Source/WebInspectorUI/UserInterface/Views/ResourceSecurityContentView.js b/Source/WebInspectorUI/UserInterface/Views/ResourceSecurityContentView.js >index da431a0d6dba503026a80a69ee19e5261ac99498..29e84412a98350839a700c93922fc0e91e4aee18 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ResourceSecurityContentView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/ResourceSecurityContentView.js >@@ -34,6 +34,7 @@ WI.ResourceSecurityContentView = class ResourceSecurityContentView extends WI.Co > this._resource = resource; > > this._insecureMessageElement = null; >+ this._needsConnectionRefresh = true; > this._needsCertificateRefresh = true; > > this._searchQuery = null; >@@ -52,10 +53,14 @@ WI.ResourceSecurityContentView = class ResourceSecurityContentView extends WI.Co > { > super.initialLayout(); > >+ this._connectionSection = new WI.ResourceDetailsSection(WI.UIString("Connection"), "connection"); >+ this.element.appendChild(this._connectionSection.element); >+ > this._certificateSection = new WI.ResourceDetailsSection(WI.UIString("Certificate"), "certificate"); > this.element.appendChild(this._certificateSection.element); > > this._resource.addEventListener(WI.Resource.Event.ResponseReceived, this._handleResourceResponseReceived, this); >+ this._resource.addEventListener(WI.Resource.Event.MetricsDidChange, this._handleResourceMetricsDidChange, this); > } > > layout() >@@ -69,6 +74,11 @@ WI.ResourceSecurityContentView = class ResourceSecurityContentView extends WI.Co > return; > } > >+ if (this._needsConnectionRefresh) { >+ this._needsConnectionRefresh = false; >+ this._refreshConnectionSection(); >+ } >+ > if (this._needsCertificateRefresh) { > this._needsCertificateRefresh = false; > this._refreshCetificateSection(); >@@ -166,20 +176,41 @@ WI.ResourceSecurityContentView = class ResourceSecurityContentView extends WI.Co > > // Private > >+ _refreshConnectionSection() >+ { >+ let detailsElement = this._connectionSection.detailsElement; >+ detailsElement.removeChildren(); >+ >+ let security = this._resource.security; >+ if (isEmptyObject(security)) { >+ this._connectionSection.markIncompleteSectionWithMessage(WI.UIString("No connection security information.")); >+ return; >+ } >+ >+ let connection = security.connection; >+ if (isEmptyObject(connection) || Object.values(connection).every((value) => !value)) { >+ this._connectionSection.markIncompleteSectionWithMessage(WI.UIString("No connection security information.")); >+ return; >+ } >+ >+ this._connectionSection.appendKeyValuePair(WI.UIString("Protocol"), connection.protocol); >+ this._connectionSection.appendKeyValuePair(WI.UIString("Cipher"), connection.cipher); >+ } >+ > _refreshCetificateSection() > { > let detailsElement = this._certificateSection.detailsElement; > detailsElement.removeChildren(); > >- let responseSecurity = this._resource.responseSecurity; >- if (!responseSecurity) { >- this._certificateSection.markIncompleteSectionWithMessage(WI.UIString("No response security information.")); >+ let security = this._resource.security; >+ if (isEmptyObject(security)) { >+ this._certificateSection.markIncompleteSectionWithMessage(WI.UIString("No certificate security information.")); > return; > } > >- let certificate = responseSecurity.certificate; >- if (!certificate) { >- this._certificateSection.markIncompleteSectionWithMessage(WI.UIString("No response security certificate.")); >+ let certificate = security.certificate; >+ if (isEmptyObject(certificate) || Object.values(certificate).every((value) => !value)) { >+ this._certificateSection.markIncompleteSectionWithMessage(WI.UIString("No certificate security information.")); > return; > } > >@@ -309,4 +340,10 @@ WI.ResourceSecurityContentView = class ResourceSecurityContentView extends WI.Co > this._needsCertificateRefresh = true; > this.needsLayout(); > } >+ >+ _handleResourceMetricsDidChange(event) >+ { >+ this._needsConnectionRefresh = true; >+ this.needsLayout(); >+ } > }; >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >index 65ff7611f08a09a89bc59edf14beaf2b0a22b0d0..66799f91a7b6564d3cdaea637061810609e7de52 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >@@ -52,6 +52,7 @@ > #import <wtf/NeverDestroyed.h> > #import <wtf/ProcessPrivilege.h> > #import <wtf/URL.h> >+#import <wtf/text/WTFString.h> > > using namespace WebKit; > >@@ -90,6 +91,221 @@ static WebCore::NetworkLoadPriority toNetworkLoadPriority(float priority) > return WebCore::NetworkLoadPriority::Medium; > } > >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) >+static String stringForSSLProtocol(SSLProtocol protocol) >+{ >+ switch (protocol) { >+ case kDTLSProtocol1: >+ return "DTLS 1.0"_s; >+ case kSSLProtocol2: >+ return "SSL 2.0"_s; >+ case kSSLProtocol3: >+ return "SSL 3.0"_s; >+ case kSSLProtocol3Only: >+ return "SSL 3.0 (Only)"_s; >+ case kTLSProtocol1: >+ return "TLS 1.0"_s; >+ case kTLSProtocol1Only: >+ return "TLS 1.0 (Only)"_s; >+ case kTLSProtocol11: >+ return "TLS 1.1"_s; >+ case kTLSProtocol12: >+ return "TLS 1.2"_s; >+ case kTLSProtocol13: >+ return "TLS 1.3"_s; >+ case kSSLProtocolAll: >+ return "All"; >+ case kSSLProtocolUnknown: >+ return "Unknown"; >+ case kTLSProtocolMaxSupported: >+ default: >+ ASSERT_NOT_REACHED(); >+ return emptyString(); >+ } >+} >+ >+static String stringForSSLCipher(SSLCipherSuite cipher) >+{ >+#define STRINGIFY_CIPHER(cipher) \ >+ case cipher: \ >+ return "" #cipher ""_s >+ >+ switch (cipher) { >+ STRINGIFY_CIPHER(SSL_RSA_EXPORT_WITH_RC4_40_MD5); >+ STRINGIFY_CIPHER(SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5); >+ STRINGIFY_CIPHER(SSL_RSA_WITH_IDEA_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_RSA_EXPORT_WITH_DES40_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_RSA_WITH_DES_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DH_DSS_WITH_DES_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DH_RSA_WITH_DES_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DHE_DSS_WITH_DES_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DHE_RSA_WITH_DES_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DH_anon_EXPORT_WITH_RC4_40_MD5); >+ STRINGIFY_CIPHER(SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DH_anon_WITH_DES_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_FORTEZZA_DMS_WITH_NULL_SHA); >+ STRINGIFY_CIPHER(SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DH_DSS_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DH_RSA_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DHE_DSS_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DHE_RSA_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DH_anon_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_AES_256_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DH_DSS_WITH_AES_256_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DH_RSA_WITH_AES_256_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DHE_DSS_WITH_AES_256_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DHE_RSA_WITH_AES_256_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DH_anon_WITH_AES_256_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_ECDSA_WITH_NULL_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_ECDSA_WITH_RC4_128_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDHE_ECDSA_WITH_NULL_SHA); >+ STRINGIFY_CIPHER(TLS_ECDHE_ECDSA_WITH_RC4_128_SHA); >+ STRINGIFY_CIPHER(TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_RSA_WITH_NULL_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_RSA_WITH_RC4_128_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_RSA_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_RSA_WITH_AES_256_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDHE_RSA_WITH_NULL_SHA); >+ STRINGIFY_CIPHER(TLS_ECDHE_RSA_WITH_RC4_128_SHA); >+ STRINGIFY_CIPHER(TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_anon_WITH_NULL_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_anon_WITH_RC4_128_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_anon_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_ECDH_anon_WITH_AES_256_CBC_SHA); >+ // STRINGIFY_CIPHER(SSL_NULL_WITH_NULL_NULL); >+ STRINGIFY_CIPHER(TLS_NULL_WITH_NULL_NULL); >+ // STRINGIFY_CIPHER(SSL_RSA_WITH_NULL_MD5); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_NULL_MD5); >+ // STRINGIFY_CIPHER(SSL_RSA_WITH_NULL_SHA); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_NULL_SHA); >+ // STRINGIFY_CIPHER(SSL_RSA_WITH_RC4_128_MD5); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_RC4_128_MD5); >+ // STRINGIFY_CIPHER(SSL_RSA_WITH_RC4_128_SHA); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_RC4_128_SHA); >+ // STRINGIFY_CIPHER(SSL_RSA_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_NULL_SHA256); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_AES_128_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_AES_256_CBC_SHA256); >+ // STRINGIFY_CIPHER(SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA); >+ // STRINGIFY_CIPHER(SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA); >+ // STRINGIFY_CIPHER(SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA); >+ // STRINGIFY_CIPHER(SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DH_DSS_WITH_AES_128_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_DH_RSA_WITH_AES_128_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_DHE_DSS_WITH_AES_128_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_DHE_RSA_WITH_AES_128_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_DH_DSS_WITH_AES_256_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_DH_RSA_WITH_AES_256_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_DHE_DSS_WITH_AES_256_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_DHE_RSA_WITH_AES_256_CBC_SHA256); >+ // STRINGIFY_CIPHER(SSL_DH_anon_WITH_RC4_128_MD5); >+ STRINGIFY_CIPHER(TLS_DH_anon_WITH_RC4_128_MD5); >+ // STRINGIFY_CIPHER(SSL_DH_anon_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DH_anon_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DH_anon_WITH_AES_128_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_DH_anon_WITH_AES_256_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_PSK_WITH_RC4_128_SHA); >+ STRINGIFY_CIPHER(TLS_PSK_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_PSK_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_PSK_WITH_AES_256_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DHE_PSK_WITH_RC4_128_SHA); >+ STRINGIFY_CIPHER(TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DHE_PSK_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DHE_PSK_WITH_AES_256_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_RSA_PSK_WITH_RC4_128_SHA); >+ STRINGIFY_CIPHER(TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_RSA_PSK_WITH_AES_128_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_RSA_PSK_WITH_AES_256_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_PSK_WITH_NULL_SHA); >+ STRINGIFY_CIPHER(TLS_DHE_PSK_WITH_NULL_SHA); >+ STRINGIFY_CIPHER(TLS_RSA_PSK_WITH_NULL_SHA); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_DHE_RSA_WITH_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_DHE_RSA_WITH_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_DH_RSA_WITH_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_DH_RSA_WITH_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_DHE_DSS_WITH_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_DHE_DSS_WITH_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_DH_DSS_WITH_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_DH_DSS_WITH_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_DH_anon_WITH_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_DH_anon_WITH_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_PSK_WITH_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_PSK_WITH_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_DHE_PSK_WITH_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_DHE_PSK_WITH_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_RSA_PSK_WITH_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_RSA_PSK_WITH_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_PSK_WITH_AES_128_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_PSK_WITH_AES_256_CBC_SHA384); >+ STRINGIFY_CIPHER(TLS_PSK_WITH_NULL_SHA256); >+ STRINGIFY_CIPHER(TLS_PSK_WITH_NULL_SHA384); >+ STRINGIFY_CIPHER(TLS_DHE_PSK_WITH_AES_128_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_DHE_PSK_WITH_AES_256_CBC_SHA384); >+ STRINGIFY_CIPHER(TLS_DHE_PSK_WITH_NULL_SHA256); >+ STRINGIFY_CIPHER(TLS_DHE_PSK_WITH_NULL_SHA384); >+ STRINGIFY_CIPHER(TLS_RSA_PSK_WITH_AES_128_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_RSA_PSK_WITH_AES_256_CBC_SHA384); >+ STRINGIFY_CIPHER(TLS_RSA_PSK_WITH_NULL_SHA256); >+ STRINGIFY_CIPHER(TLS_RSA_PSK_WITH_NULL_SHA384); >+ STRINGIFY_CIPHER(TLS_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_CHACHA20_POLY1305_SHA256); >+ STRINGIFY_CIPHER(TLS_AES_128_CCM_SHA256); >+ STRINGIFY_CIPHER(TLS_AES_128_CCM_8_SHA256); >+ STRINGIFY_CIPHER(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384); >+ STRINGIFY_CIPHER(TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384); >+ STRINGIFY_CIPHER(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384); >+ STRINGIFY_CIPHER(TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256); >+ STRINGIFY_CIPHER(TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384); >+ STRINGIFY_CIPHER(TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256); >+ STRINGIFY_CIPHER(TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384); >+ STRINGIFY_CIPHER(TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256); >+ STRINGIFY_CIPHER(TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256); >+ STRINGIFY_CIPHER(TLS_EMPTY_RENEGOTIATION_INFO_SCSV); >+ STRINGIFY_CIPHER(SSL_RSA_WITH_RC2_CBC_MD5); >+ STRINGIFY_CIPHER(SSL_RSA_WITH_IDEA_CBC_MD5); >+ STRINGIFY_CIPHER(SSL_RSA_WITH_DES_CBC_MD5); >+ STRINGIFY_CIPHER(SSL_RSA_WITH_3DES_EDE_CBC_MD5); >+ STRINGIFY_CIPHER(SSL_NO_SUCH_CIPHERSUITE); >+ default: >+ ASSERT_NOT_REACHED(); >+ return emptyString(); >+ } >+ >+#undef STRINGIFY_CIPHER >+} >+#endif >+ > @interface WKNetworkSessionDelegate : NSObject <NSURLSessionDataDelegate> { > RefPtr<WebKit::NetworkSessionCocoa> _session; > bool _withCredentials; >@@ -442,6 +658,11 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didFini > networkLoadMetrics.connectionIdentifier = String([m._connectionIdentifier UUIDString]); > #endif > >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) >+ networkLoadMetrics.tlsProtocol = stringForSSLProtocol(m._negotiatedTLSProtocol); >+ networkLoadMetrics.tlsCipher = stringForSSLCipher(m._negotiatedTLSCipher); >+#endif >+ > __block WebCore::HTTPHeaderMap requestHeaders; > [m.request.allHTTPHeaderFields enumerateKeysAndObjectsUsingBlock:^(NSString *name, NSString *value, BOOL *) { > requestHeaders.set(String(name), String(value)); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 28d445a7e29d4973bf15c1efc13310112a215c30..cbcd88f4ad327d14470086bfff55130459ee08ee 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,24 @@ >+2018-12-17 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Network: show secure connection details per-request >+ https://bugs.webkit.org/show_bug.cgi?id=191539 >+ <rdar://problem/45979891> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/tests/inspector/network/resource-security-connection-expected.txt: Added. >+ * http/tests/inspector/network/resource-security-connection.html: Added. >+ >+ * http/tests/inspector/network/resource-security-certificate-expected.txt: Added. >+ * http/tests/inspector/network/resource-security-certificate.html: Added. >+ * http/tests/inspector/network/resource-response-security-expected.txt: Deleted. >+ * http/tests/inspector/network/resource-response-security.html: Deleted. >+ >+ * platform/gtk/TestExpectations: >+ * platform/mac/TestExpectations: >+ * platform/wincairo/TestExpectations: >+ * platform/wpe/TestExpectations: >+ > 2018-12-15 Youenn Fablet <youenn@apple.com> > > Make RTCRtpSender.setParameters to activate specific encodings >diff --git a/LayoutTests/http/tests/inspector/network/resource-response-security-expected.txt b/LayoutTests/http/tests/inspector/network/resource-response-security-expected.txt >deleted file mode 100644 >index ddcd7f2cdde4938facd70a4ddbfdac4fdce9be2d..0000000000000000000000000000000000000000 >--- a/LayoutTests/http/tests/inspector/network/resource-response-security-expected.txt >+++ /dev/null >@@ -1,12 +0,0 @@ >-Tests that a resource has security information. >- >- >-== Running test suite: Resource.Security >--- Running test case: Resource.Security.Certificate >-PASS: Resource should have been loaded securely. >-PASS: Resource should have security information. >-PASS: Security information should include certificate information. >-PASS: Certificate should have subject >-PASS: Certificate should have a validFrom date. >-PASS: Certificate should have a validUntil date. >- >diff --git a/LayoutTests/http/tests/inspector/network/resource-response-security.html b/LayoutTests/http/tests/inspector/network/resource-response-security.html >deleted file mode 100644 >index 4482ecf3dea945574dc6a869078a191bb08ebd58..0000000000000000000000000000000000000000 >--- a/LayoutTests/http/tests/inspector/network/resource-response-security.html >+++ /dev/null >@@ -1,49 +0,0 @@ >-<!DOCTYPE html> >-<html> >-<head> >-<meta charset="utf-8"> >-<script src="../resources/inspector-test.js"></script> >-<script> >-function createSecureRequest() { >- let img = document.createElement("img"); >- img.src = "https://localhost:8443/resources/square100.png"; >- document.body.appendChild(img); >-} >- >-function test() >-{ >- let suite = InspectorTest.createAsyncSuite("Resource.Security"); >- >- suite.addTestCase({ >- name: "Resource.Security.Certificate", >- description: "Check if a resource has security certificate information.", >- test(resolve, reject) { >- WI.Resource.awaitEvent(WI.Resource.Event.ResponseReceived) >- .then((event) => { >- let resource = event.target; >- InspectorTest.expectThat(resource.loadedSecurely, "Resource should have been loaded securely."); >- >- let responseSecurity = resource.responseSecurity; >- InspectorTest.expectNotNull(responseSecurity, "Resource should have security information."); >- >- let certificate = responseSecurity.certificate; >- InspectorTest.expectNotNull(certificate, "Security information should include certificate information."); >- InspectorTest.expectGreaterThan(certificate.subject.length, 0, "Certificate should have subject"); >- InspectorTest.expectGreaterThan(certificate.validFrom, 0, "Certificate should have a validFrom date."); >- InspectorTest.expectGreaterThan(certificate.validUntil, 0, "Certificate should have a validUntil date."); >- }) >- .then(resolve, reject); >- >- InspectorTest.evaluateInPage(`createSecureRequest()`) >- .catch(reject); >- } >- }); >- >- suite.runTestCasesAndFinish(); >-} >-</script> >-</head> >-<body onload="runTest()"> >- <p>Tests that a resource has security information.</p> >-</body> >-</html> >diff --git a/LayoutTests/http/tests/inspector/network/resource-security-certificate-expected.txt b/LayoutTests/http/tests/inspector/network/resource-security-certificate-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..99dfe85770249ead5db57fbcc5427f9d452a20a4 >--- /dev/null >+++ b/LayoutTests/http/tests/inspector/network/resource-security-certificate-expected.txt >@@ -0,0 +1,12 @@ >+Tests for resource security certificate information. >+ >+ >+== Running test suite: Resource.Security.Certificate >+-- Running test case: Resource.Security.Certificate.Basic >+PASS: Resource should have been loaded securely. >+PASS: Resource should have security information. >+PASS: Security information should include certificate information. >+PASS: Certificate should have subject. >+PASS: Certificate should have a validFrom date. >+PASS: Certificate should have a validUntil date. >+ >diff --git a/LayoutTests/http/tests/inspector/network/resource-security-certificate.html b/LayoutTests/http/tests/inspector/network/resource-security-certificate.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0919833500a7da356befa91d08f60e193f45e334 >--- /dev/null >+++ b/LayoutTests/http/tests/inspector/network/resource-security-certificate.html >@@ -0,0 +1,51 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<script src="../resources/inspector-test.js"></script> >+<script> >+let requestCount = 0; >+ >+function createSecureRequest() { >+ let img = document.createElement("img"); >+ img.src = "https://localhost:8443/resources/square100.png?" + (++requestCount); >+ document.body.appendChild(img); >+} >+ >+function test() >+{ >+ let suite = InspectorTest.createAsyncSuite("Resource.Security.Certificate"); >+ >+ suite.addTestCase({ >+ name: "Resource.Security.Certificate.Basic", >+ description: "Check if a resource has security certificate information.", >+ test(resolve, reject) { >+ WI.Resource.awaitEvent(WI.Resource.Event.ResponseReceived) >+ .then((event) => { >+ let resource = event.target; >+ InspectorTest.expectThat(resource.loadedSecurely, "Resource should have been loaded securely."); >+ >+ let security = resource.security; >+ InspectorTest.expectNotNull(security, "Resource should have security information."); >+ >+ let certificate = security.certificate; >+ InspectorTest.expectNotNull(certificate, "Security information should include certificate information."); >+ InspectorTest.expectGreaterThan(certificate.subject.length, 0, "Certificate should have subject."); >+ InspectorTest.expectGreaterThan(certificate.validFrom, 0, "Certificate should have a validFrom date."); >+ InspectorTest.expectGreaterThan(certificate.validUntil, 0, "Certificate should have a validUntil date."); >+ }) >+ .then(resolve, reject); >+ >+ InspectorTest.evaluateInPage(`createSecureRequest()`) >+ .catch(reject); >+ } >+ }); >+ >+ suite.runTestCasesAndFinish(); >+} >+</script> >+</head> >+<body onload="runTest()"> >+ <p>Tests for resource security certificate information.</p> >+</body> >+</html> >diff --git a/LayoutTests/http/tests/inspector/network/resource-security-connection-expected.txt b/LayoutTests/http/tests/inspector/network/resource-security-connection-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..932fb5de49cd35558281f49f73b6ae0f4666e044 >--- /dev/null >+++ b/LayoutTests/http/tests/inspector/network/resource-security-connection-expected.txt >@@ -0,0 +1,11 @@ >+Tests for resource security connection information. >+ >+ >+== Running test suite: Resource.Security.Connection >+-- Running test case: Resource.Security.Connection.Basic >+PASS: Resource should have been loaded securely. >+PASS: Resource should have security information. >+PASS: Security information should include connection information. >+PASS: Connection should have protocol. >+PASS: Connection should have cipher. >+ >diff --git a/LayoutTests/http/tests/inspector/network/resource-security-connection.html b/LayoutTests/http/tests/inspector/network/resource-security-connection.html >new file mode 100644 >index 0000000000000000000000000000000000000000..6e9fcc3066d5dc80ed02d0221009166852cd7616 >--- /dev/null >+++ b/LayoutTests/http/tests/inspector/network/resource-security-connection.html >@@ -0,0 +1,50 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<script src="../resources/inspector-test.js"></script> >+<script> >+let requestCount = 0; >+ >+function createSecureRequest() { >+ let img = document.createElement("img"); >+ img.src = "https://localhost:8443/resources/square100.png?" + (++requestCount); >+ document.body.appendChild(img); >+} >+ >+function test() >+{ >+ let suite = InspectorTest.createAsyncSuite("Resource.Security.Connection"); >+ >+ suite.addTestCase({ >+ name: "Resource.Security.Connection.Basic", >+ description: "Check if a resource has security connection information.", >+ test(resolve, reject) { >+ WI.Resource.awaitEvent(WI.Resource.Event.ResponseReceived) >+ .then((event) => { >+ let resource = event.target; >+ InspectorTest.expectThat(resource.loadedSecurely, "Resource should have been loaded securely."); >+ >+ let security = resource.security; >+ InspectorTest.expectNotNull(security, "Resource should have security information."); >+ >+ let connection = security.connection; >+ InspectorTest.expectNotNull(connection, "Security information should include connection information."); >+ InspectorTest.expectGreaterThan(connection.protocol.length, 0, "Connection should have protocol."); >+ InspectorTest.expectGreaterThan(connection.cipher.length, 0, "Connection should have cipher."); >+ }) >+ .then(resolve, reject); >+ >+ InspectorTest.evaluateInPage(`createSecureRequest()`) >+ .catch(reject); >+ } >+ }); >+ >+ suite.runTestCasesAndFinish(); >+} >+</script> >+</head> >+<body onload="runTest()"> >+ <p>Tests for resource security connection information.</p> >+</body> >+</html> >diff --git a/LayoutTests/platform/gtk/TestExpectations b/LayoutTests/platform/gtk/TestExpectations >index 2aad6a738d051e1fafb88fef119518b666644d5d..c936135982fe2896d0a7bea746661292e3b7584a 100644 >--- a/LayoutTests/platform/gtk/TestExpectations >+++ b/LayoutTests/platform/gtk/TestExpectations >@@ -1966,7 +1966,8 @@ webkit.org/b/186750 imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_key > webkit.org/b/186750 imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/test_pbkdf2_short_long.https.html [ Pass Failure ] > > webkit.org/b/186847 http/tests/inspector/network/resource-sizes-memory-cache.html [ Pass Failure ] >-webkit.org/b/191497 http/tests/inspector/network/resource-response-security.html [ Skip ] >+webkit.org/b/192407 http/tests/inspector/network/resource-security-connection.html [ Skip ] >+webkit.org/b/191497 http/tests/inspector/network/resource-security-certificate.html [ Skip ] > webkit.org/b/191497 http/tests/inspector/network/getSerializedCertificate.html [ Skip ] > > webkit.org/b/186851 imported/w3c/web-platform-tests/xhr/formdata.htm [ Pass Failure ] >diff --git a/LayoutTests/platform/mac/TestExpectations b/LayoutTests/platform/mac/TestExpectations >index 37a5b0fef0baa0486300218920658cdfeed21deb..32edbc147d4695c469b6cab3fca13ae35cff6672 100644 >--- a/LayoutTests/platform/mac/TestExpectations >+++ b/LayoutTests/platform/mac/TestExpectations >@@ -1108,6 +1108,7 @@ webkit.org/b/158006 inspector/console/console-time.html [ Pass Timeout ] > webkit.org/b/183880 [ Debug ] inspector/console/messageAdded-from-named-evaluations.html [ Slow ] > webkit.org/b/156634 inspector/formatting/formatting-javascript.html [ Pass Timeout ] > webkit.org/b/158948 inspector/timeline [ Pass Timeout ] >+webkit.org/b/191539 http/tests/inspector/network/resource-security-connection.html [ Skip ] > > webkit.org/b/187622 [ Debug ] inspector/view/asynchronous-layout.html [ Pass Timeout ] > >diff --git a/LayoutTests/platform/wincairo/TestExpectations b/LayoutTests/platform/wincairo/TestExpectations >index a6e4724dd9fdf25c48f3359f7fecc5bc26f925af..d49a08eecfe82cad6d785e88c07b688bb63c1b47 100644 >--- a/LayoutTests/platform/wincairo/TestExpectations >+++ b/LayoutTests/platform/wincairo/TestExpectations >@@ -999,7 +999,8 @@ http/tests/xmlhttprequest/upload-progress-events.html [ Failure ] > > http/tests/xmlviewer [ Skip ] > >-webkit.org/b/191498 http/tests/inspector/network/resource-response-security.html [ Skip ] >+webkit.org/b/192406 http/tests/inspector/network/resource-security-connection.html [ Skip ] >+webkit.org/b/191498 http/tests/inspector/network/resource-security-certificate.html [ Skip ] > webkit.org/b/191498 http/tests/inspector/network/getSerializedCertificate.html [ Skip ] > > #/////////////////////////////////////////////////////////////////////////////// >diff --git a/LayoutTests/platform/wpe/TestExpectations b/LayoutTests/platform/wpe/TestExpectations >index a2df5e2ce902dcc65449df8f17ce03cce25b956c..86a366ca87120c7729cb549b5d1149a14767c082 100644 >--- a/LayoutTests/platform/wpe/TestExpectations >+++ b/LayoutTests/platform/wpe/TestExpectations >@@ -531,7 +531,8 @@ Bug(WPE) fast/history/page-cache-notification-suspendable.html [ Skip ] > > Bug(WPE) fast/dom/HTMLAnchorElement [ Skip ] > >-webkit.org/b/191497 http/tests/inspector/network/resource-response-security.html [ Skip ] >+webkit.org/b/192407 http/tests/inspector/network/resource-security-connection.html [ Skip ] >+webkit.org/b/191497 http/tests/inspector/network/resource-security-certificate.html [ Skip ] > webkit.org/b/191497 http/tests/inspector/network/getSerializedCertificate.html [ Skip ] > > #////////////////////////////////////////////////////////////////////////////////////////
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 191539
:
354871
|
354879
|
354884
|
354886
|
354892
|
356614
|
356624
|
357511
|
357512
|
357517
|
357522
|
357524
|
357530