You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ref/dotz.md
+35-3Lines changed: 35 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,15 +209,44 @@ The number of physical cores.
209
209
210
210
## `.z.e` (TLS connection status)
211
211
212
-
TLS details used with a connection handle. Returns an empty dictionary if the connection is not TLS enabled. E.g. where `h` is a connection handle.
212
+
TLS details used with the current connection handle.
213
+
Returns an empty dictionary if the connection is not TLS enabled.
214
+
215
+
Displays information on the following
216
+
217
+
*`CIPHER` is the name of cipher used for the connection
218
+
*`PROTOCOL` is the name of the protocol used for the connection, for example `` `TLSv1.2 ``
219
+
*`CERT` is the X509 certificate the peer presented. It is not present if the peer certificate was not provided.
220
+
221
+
For example, the following connects to a server, then runs `.z.e` on the server to gain information on the TLS connection handle used by the client. Therefore `CERT` is the client certificate (peer of the server).
222
+
If [`SSL_VERIFY_CLIENT`](../kb/ssl.md#ssl_verify_client) is not enabled on the server, the client certificate is not requested by the server, and therefore would not be displayed.
The following shows the client sending a message to the server, which in turn sends `.z.e` to the client (using the current connection handle [`.z.w`](#zw-handle)), displaying the server certificate used by the client connection.
When called from code executing a client callback function due to a client request, it can be used to gain TLS information on the client connection.
242
+
For example, the following implements the connection open callback ([`.z.po`](#zpo-open)) to print TLS information each time a client connects.
243
+
244
+
```q
245
+
.z.po:{show"SSL server connection info:";show .z.e;show"SSL client connection info:";show .z.w".z.e"}
246
+
```
247
+
248
+
`.z.w".z.e"` is used to run .z.e on the client (via a [sync request](../basics/ipc.md#sync-request-get) over the connection provided by [`.z.w`](#zw-handle))
249
+
221
250
Since V3.4 2016.05.16. `CERT` details of `VERIFIED`,`VERIFYERROR` available since 4.1t 2024.02.07.
222
251
223
252
:fontawesome-solid-hand-point-right:
@@ -950,7 +979,9 @@ q)m[1;1]:0
950
979
## `.z.W` (handles)
951
980
952
981
Dictionary of IPC handles with the number of bytes waiting in their output queues.
982
+
[`.z.H`](#zh-active-sockets) is a lower cost method if the size of the output queue is not required.
953
983
984
+
The following demonstrates a client connection which has created [async requests](../basics/ipc.md#async-message-set), causing pending data in its connection output queue.
The current connection handle. When called within the current session console, it will return 0i.
992
1023
993
1024
```q
994
1025
q).z.w
995
1026
0i
996
1027
```
997
1028
998
-
!!! warning "Inside a `.z.p`* callback it returns the handle of the client session, not the current session."
1029
+
When called from code executing a client callback function due to a client request, for example [`.z.pg`](#zpg-get), it returns the handle of the client connection.
1030
+
This can be used for performing tasks such as sending a [sync/async request](../basics/ipc.md#send-messages) to the client or recording the handle upon which a request should be later fulfilled.
0 commit comments