Skip to content

Commit

Permalink
v1.13.1 fix bug when using ServerCertSKI
Browse files Browse the repository at this point in the history
  • Loading branch information
bpbecker committed Apr 24, 2023
1 parent 00349e9 commit e28eeec
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions Source/Jarvis.dyalog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

(⎕ML ⎕IO)1 1

rVersion
:Access public shared
r'Jarvis' '1.13.1' '2022-04-21'

User hooks settings
:Field Public AppCloseFn'' name of the function to run on application (server) shutdown
:Field Public AppInitFn'' name of the application "bootstrap" function
Expand Down Expand Up @@ -117,11 +122,6 @@
:Field _excludeRegex'' private compiled regex from _ExcludeFns
:Field _connections namespace containing open connections

rVersion
:Access public shared
r'Jarvis' '1.13.0' '2022-04-18'

rConfig
returns current configuration
:Access public
Expand Down Expand Up @@ -515,7 +515,7 @@
∆EXIT:

(rc msg secureParams)CreateSecureParams;cert;certs;msg;mask;matchID
(rc msg secureParams)CreateSecureParams;cert;certs;msg;inds
return Conga parameters for running HTTPS, if Secure is set to 1

LDRC.X509Cert.LDRCLDRC make sure the X509 instance points to the right LDRC
Expand All @@ -539,14 +539,13 @@
:If 0certs
∆EXIT(rc msg)8 'No certificates found in Microsoft Certificate Store'
:Else
matchID{'id=(.*);'⎕S'\1''Greedy' 02¨z.CertOrigin}2¨certs.CertOrigin
maskServerCertSKI{/¨()¨2¨}certs.CertOrigin
:If 1+/mask
inds1+('id=',ServerCertSKI,';')⎕S{.BlockNum}'Greedy' 02¨certs.CertOrigin
:If 1inds
rc9
msg(0 2+/mask)('Certificate with id "',ServerCertSKI,'" was not found in the Microsoft Certificate Store')('There is more than one certificate with Subject Key Identifier "',ServerCertSKI,'" in the Microsoft Certificate Store')
msg(0 2inds)('Certificate with id "',ServerCertSKI,'" was not found in the Microsoft Certificate Store')('There is more than one certificate with Subject Key Identifier "',ServerCertSKI,'" in the Microsoft Certificate Store')
∆EXIT
:EndIf
certcerts[mask]
certcerts[inds]
:EndIf
:Else ServerCertSKI is defined, but we're not running Windows
∆EXIT(rc msg)10 'ServerCertSKI is currently valid only under Windows'
Expand Down Expand Up @@ -835,6 +834,14 @@

:Section RequestHandling

rErrorInfo
:Trap 0
rErrorInfoLevel⎕DMX.(EM({']'}2DM))
:Else
r''
:EndTrap

reqMakeRequest args
create a request, use MakeRequest '' for interactive debugging
:Access public
Expand Down Expand Up @@ -1006,7 +1013,7 @@
Endns.Req.Fail 204 no content
:EndTrap
:Else
Endns.Req.Fail 500
EndErrorInfo ns.Req.Fail 500
:EndTrap
↓↓↓ removed this next line because a non-2XX response might still have a payload
→0 If 2≠⌊0.01×ns.Req.Response.Status ⍝ exit if not a successful HTTP code
Expand Down Expand Up @@ -1197,7 +1204,7 @@
:Field Public Instance PeerAddr'unknown' client IP address
:Field Public Instance PeerCert0 0'' client certificate
:Field Public Instance HTTPVersion''
:Field Public Instance ErrorInfoLevel2
:Field Public Instance ErrorInfoLevel1
:Field Public Instance Response
:Field Public Instance Server
:Field Public Instance Session
Expand Down

0 comments on commit e28eeec

Please sign in to comment.