WebKit Bugzilla
Attachment 356614 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-20181205100411.patch (text/plain), 51.51 KB, created by
Devin Rousso
on 2018-12-05 10:04:13 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2018-12-05 10:04:13 PST
Size:
51.51 KB
patch
obsolete
>diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 88097719819bcfaefe85fe48b72f36cc09615ca0..b148243a38c30f37b83bdf9ef31f5043ef4849b3 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-12-05 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` information when a request finishes loading. >+ > 2018-12-04 Caio Lima <ticaiolima@gmail.com> > > [ESNext][BigInt] Support logic operations >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9e7aeb8411f416d86d3b73c3bef828f5a9d8c6f3..66078d71688231961d9a67ad251d2015851e9952 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-12-05 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::didFinishLoading): >+ > 2018-12-04 Justin Michaud <justin_michaud@apple.com> > > CSS Painting API should allow image values in inputProperties >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index c5bdd164d31f3577eb51c328da727419966665cb..73a6e88371ef584c2b5ff1487b2907dc419b94ab 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,13 @@ >+2018-12-05 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-02 Zalan Bujtas <zalan@apple.com> > > Add a runtime feature flag for LayoutFormattingContext. >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 9271caa8a2edab6b000f0e46c3c0d9f4824a98a0..bec982e7f2fa625d4048633f95175717553bd674 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,34 @@ >+2018-12-05 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.updateSecurity): Added. >+ (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._handleResourceSecurityChanged): Added. >+ (WI.ResourceSecurityContentView.prototype._handleResourceResponseReceived): Deleted. >+ * 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-04 Matt Baker <mattbaker@apple.com> > > Web Inspector: REGRESSION(r238602): Elements: changing selection no longer highlights the selected node >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 55dff1c019a85fac4133ba17220afb152054583b..08eb40b403e90390d5bb261f4a3026b0d810356a 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2018-12-05 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-04 Chris Dumez <cdumez@apple.com> > > Regression(r238817) PSON Page Cache API tests are failing >diff --git a/Source/JavaScriptCore/inspector/protocol/Network.json b/Source/JavaScriptCore/inspector/protocol/Network.json >index 338d74566607339717577018fb9139238db2b891..d092b9bf5908614543ef3add9e93d04f77eb0061 100644 >--- a/Source/JavaScriptCore/inspector/protocol/Network.json >+++ b/Source/JavaScriptCore/inspector/protocol/Network.json >@@ -267,7 +267,8 @@ > { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }, > { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, > { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with this resource (if any)." }, >- { "name": "metrics", "$ref": "Metrics", "optional": true, "description": "Network metrics." } >+ { "name": "metrics", "$ref": "Metrics", "optional": true, "description": "Network metrics." }, >+ { "name": "security", "$ref": "Security.Security", "optional": true, "description": "Resolved security 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..1775358d2b199669ff4f466feb8dc92f43da560f 100644 >--- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp >@@ -572,9 +572,22 @@ void InspectorNetworkAgent::didFinishLoading(unsigned long identifier, DocumentL > realMetrics = platformStrategies()->loaderStrategy()->networkMetricsFromResourceLoadIdentifier(identifier).isolatedCopy(); > }); > } >- RefPtr<Inspector::Protocol::Network::Metrics> metrics = buildObjectForMetrics(realMetrics ? *realMetrics : networkLoadMetrics); >+ auto metrics = realMetrics ? realMetrics.value() : networkLoadMetrics; > >- m_frontendDispatcher->loadingFinished(requestId, elapsedFinishTime, !sourceMappingURL.isEmpty() ? &sourceMappingURL : nullptr, metrics); >+ RefPtr<Inspector::Protocol::Network::Metrics> metricsPayload = buildObjectForMetrics(realMetrics ? *realMetrics : networkLoadMetrics); >+ >+ auto securityPayload = Inspector::Protocol::Security::Security::create() >+ .release(); >+ >+ auto connectionPayload = Inspector::Protocol::Security::Connection::create() >+ .release(); >+ >+ connectionPayload->setProtocol(networkLoadMetrics.tlsProtocol); >+ connectionPayload->setCipher(networkLoadMetrics.tlsCipher); >+ >+ securityPayload->setConnection(WTFMove(connectionPayload)); >+ >+ m_frontendDispatcher->loadingFinished(requestId, elapsedFinishTime, !sourceMappingURL.isEmpty() ? &sourceMappingURL : nullptr, metricsPayload, WTFMove(securityPayload)); > } > > void InspectorNetworkAgent::didFailLoading(unsigned long identifier, DocumentLoader* loader, const ResourceError& error) >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/Controllers/NetworkManager.js b/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js >index 0344e5545df97f258c07e3c9b8f01f42ca9235e3..475cea4b508993070a97e4ef247d9c81a382d4c2 100644 >--- a/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js >+++ b/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js >@@ -521,7 +521,7 @@ WI.NetworkManager = class NetworkManager extends WI.Object > resource.increaseTransferSize(encodedDataLength); > } > >- resourceRequestDidFinishLoading(requestIdentifier, timestamp, sourceMapURL, metrics) >+ resourceRequestDidFinishLoading(requestIdentifier, timestamp, sourceMapURL, metrics, security) > { > // Called from WI.NetworkObserver. > >@@ -539,6 +539,8 @@ WI.NetworkManager = class NetworkManager extends WI.Object > if (metrics) > resource.updateWithMetrics(metrics); > >+ resource.updateSecurity(security); >+ > let elapsedTime = WI.timelineManager.computeElapsedTime(timestamp); > resource.markAsFinished(elapsedTime); > >diff --git a/Source/WebInspectorUI/UserInterface/Models/Resource.js b/Source/WebInspectorUI/UserInterface/Models/Resource.js >index a0a9beb5e64fb05a3bb1e6632d712fee1ad3df9d..8c682e65cf1402568b883ef7f162a66bf6158e77 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; } >@@ -715,8 +715,7 @@ WI.Resource = class Resource extends WI.SourceCode > if (source) > this._responseSource = WI.Resource.responseSourceFromPayload(source); > >- if (security) >- this._responseSecurity = security; >+ this.updateSecurity(security); > > const headerBaseSize = 12; // Length of "HTTP/1.1 ", " ", and "\r\n". > const headerPad = 4; // Length of ": " and "\r\n". >@@ -796,6 +795,22 @@ WI.Resource = class Resource extends WI.SourceCode > this.dispatchEventToListeners(WI.Resource.Event.MetricsDidChange); > } > >+ updateSecurity(security) >+ { >+ if (isEmptyObject(security)) >+ return; >+ >+ if (!this._security) >+ this._security = {}; >+ >+ for (let key in security) { >+ console.assert(!(key in this._security), "Duplicate security data", key, this._security[key], security[key]); >+ this._security[key] = security[key]; >+ } >+ >+ this.dispatchEventToListeners(WI.Resource.Event.SecurityChanged); >+ } >+ > setCachedResponseBodySize(size) > { > console.assert(!isNaN(size), "Size should be a valid number."); >@@ -1100,6 +1115,7 @@ WI.Resource.Event = { > CacheStatusDidChange: "resource-cached-did-change", > MetricsDidChange: "resource-metrics-did-change", > InitiatedResourcesDidChange: "resource-initiated-resources-did-change", >+ SecurityChanged: "resource-security-changed", > }; > > // Keep these in sync with the "ResourceType" enum defined by the "Page" domain. >diff --git a/Source/WebInspectorUI/UserInterface/Protocol/NetworkObserver.js b/Source/WebInspectorUI/UserInterface/Protocol/NetworkObserver.js >index e927888154897ece56ad4237d62b8c5d6967e9e9..8ac5a99a09bd13ddee10f88cdc9621e97e1b1fb9 100644 >--- a/Source/WebInspectorUI/UserInterface/Protocol/NetworkObserver.js >+++ b/Source/WebInspectorUI/UserInterface/Protocol/NetworkObserver.js >@@ -57,9 +57,9 @@ WI.NetworkObserver = class NetworkObserver > WI.networkManager.resourceRequestDidReceiveData(requestId, dataLength, encodedDataLength, timestamp); > } > >- loadingFinished(requestId, timestamp, sourceMapURL, metrics) >+ loadingFinished(requestId, timestamp, sourceMapURL, metrics, security) > { >- WI.networkManager.resourceRequestDidFinishLoading(requestId, timestamp, sourceMapURL, metrics); >+ WI.networkManager.resourceRequestDidFinishLoading(requestId, timestamp, sourceMapURL, metrics, security); > } > > loadingFailed(requestId, timestamp, errorText, canceled) >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..f32ad1a7f740e94a00eb791fcb8d7de753031d0f 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,13 @@ 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.SecurityChanged, this._handleResourceSecurityChanged, this); > } > > layout() >@@ -69,6 +73,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 +175,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; > } > >@@ -304,8 +334,9 @@ WI.ResourceSecurityContentView = class ResourceSecurityContentView extends WI.Co > this.element.appendChild(this._bouncyHighlightElement); > } > >- _handleResourceResponseReceived(event) >+ _handleResourceSecurityChanged(event) > { >+ this._needsConnectionRefresh = true; > this._needsCertificateRefresh = true; > this.needsLayout(); > } >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >index b3ecbc9ef9ff7a9817ba2f45f8b2c21d7af46319..9de2a1d8009dbd40477b30125b46313f71aa6290 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; > >@@ -93,6 +94,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"_s; >+ case kSSLProtocolUnknown: >+ return "Unknown"_s; >+ 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_NULL_WITH_NULL_NULL); >+ // STRINGIFY_CIPHER(SSL_RSA_WITH_NULL_MD5); >+ // STRINGIFY_CIPHER(SSL_RSA_WITH_NULL_SHA); >+ STRINGIFY_CIPHER(SSL_RSA_EXPORT_WITH_RC4_40_MD5); >+ // STRINGIFY_CIPHER(SSL_RSA_WITH_RC4_128_MD5); >+ // STRINGIFY_CIPHER(SSL_RSA_WITH_RC4_128_SHA); >+ 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_RSA_WITH_3DES_EDE_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_DSS_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DH_RSA_WITH_DES_CBC_SHA); >+ // STRINGIFY_CIPHER(SSL_DH_RSA_WITH_3DES_EDE_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_DSS_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DHE_RSA_WITH_DES_CBC_SHA); >+ // STRINGIFY_CIPHER(SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DH_anon_EXPORT_WITH_RC4_40_MD5); >+ // STRINGIFY_CIPHER(SSL_DH_anon_WITH_RC4_128_MD5); >+ STRINGIFY_CIPHER(SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA); >+ STRINGIFY_CIPHER(SSL_DH_anon_WITH_DES_CBC_SHA); >+ // STRINGIFY_CIPHER(SSL_DH_anon_WITH_3DES_EDE_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(TLS_NULL_WITH_NULL_NULL); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_NULL_MD5); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_NULL_SHA); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_RC4_128_MD5); >+ STRINGIFY_CIPHER(TLS_RSA_WITH_RC4_128_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(TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA); >+ STRINGIFY_CIPHER(TLS_DHE_DSS_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(TLS_DH_anon_WITH_RC4_128_MD5); >+ 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; >@@ -445,6 +661,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 5494364d98e06db9aee55f8119eed2cf074b002a..f693a2beb3fd2c8beadfd44cc0f461d5f94d024e 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,24 @@ >+2018-12-05 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-04 Justin Michaud <justin_michaud@apple.com> > > CSS Painting API should allow image values in inputProperties >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 502384c7da7ad8098bbf9b2c770ece13b47f8136..ed12f2e41af31ac9776d6dc916cb39e4db26c9a1 100644 >--- a/LayoutTests/platform/gtk/TestExpectations >+++ b/LayoutTests/platform/gtk/TestExpectations >@@ -1981,7 +1981,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 7ca2206a746f5bab48ef03b0e761a700d6b7e873..d9668a2cb57d7c65c85963b09fb06098bce519c4 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 32c07055b17b38d51e3b355157ce9e792c50cf9b..aa23a27ebd29ac83a94efcbf53fffca5ae1f4c79 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