Skip to content

Commit d304449

Browse files
authored
Merge pull request #31 from anonrig/yagiz/add-upgraded-value
2 parents 34e9fc9 + 99f8e3c commit d304449

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

index.bs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ interface Socket {
111111
readonly attribute Promise<undefined> closed;
112112
Promise<undefined> close(optional any reason);
113113

114+
readonly attribute boolean upgraded;
115+
114116
[NewObject] Socket startTls();
115117
};
116118
</pre>
@@ -205,6 +207,10 @@ It can also be rejected with a [=SocketError=] when a socket connection could no
205207

206208
Cancelling the socket's ReadableStream and closing the socket's WritableStream does not resolve the `closed` promise.
207209

210+
<h4 id="upgraded-attribute">upgraded</h4>
211+
212+
The {{upgraded}} attribute is a boolean flag that indicates whether the socket has been upgraded to a secure connection (using `startTLS()`).
213+
208214
<h3 id="methods">Methods</h3>
209215

210216
<h4 id="close-method">close(optional any reason)</h4>
@@ -224,6 +230,7 @@ The {{startTls()}} method enables opportunistic TLS (otherwise known as [StartTL
224230
In this `secureTransport` mode of operation the socket begins the connection in plain-text, with messages read and written without any encryption. Then once the `startTls` method is called on the socket, the following shall take place:
225231

226232
<ul>
233+
<li>the original socket "upgraded" attribute is set to true</li>
227234
<li>the original socket is closed, though the original connection is kept alive</li>
228235
<li>a secure TLS connection is established over that connection</li>
229236
<li>a new socket is created and returned from the `startTls` call</li>
@@ -377,7 +384,7 @@ At any point during the creation of the {{Socket}} instance, `connect` may throw
377384
{{alpn}} property
378385
</dt>
379386
<dd>
380-
If the server agrees with one of the protocols specified in the `alpn` negotiation list, returns that protocol name as a string, otherwise `null`.
387+
If the server agrees with one of the protocols specified in the `alpn` negotiation list, returns that protocol name as a string, otherwise `null`.
381388
</dd>
382389
</dl>
383390

0 commit comments

Comments
 (0)