Re: The Inbox: SqueakSSL-Core-ct.37.mcz
"Marcel Taeumel (H) via Squeak-dev" <[email protected]>
| Newsgroups | gmane.comp.lang.smalltalk.squeak.general |
|---|---|
| Message-ID | <[email protected]> |
FYI, here is the official SqueakSSL repo for the platform-specific implementations: - https://github.com/squeak-smalltalk/squeakssl Any changes should be synchronized with the OSVM repository - https://github.com/OpenSmalltalk/opensmalltalk-vm/tree/Cog/platforms/*/plugins/SqueakSSL Best Marcel Am 26.04.2026 um 20:20 schrieb [email protected]: > Christoph Thiede uploaded a new version of SqueakSSL-Core to project The Inbox: > http://source.squeak.org/inbox/SqueakSSL-Core-ct.37.mcz > > ==================== Summary ==================== > > Name: SqueakSSL-Core-ct.37 > Author: ct > Time: 26 April 2026, 8:20:32.577153 pm > UUID: 930ef705-e572-4ef9-9c19-653e40e3cf2a > Ancestors: SqueakSSL-Core-mt.36 > > Handles handshake output returned after connection success to support TLS 1.3. Complements VM change in https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/768. > > =============== Diff against SqueakSSL-Core-mt.36 =============== > > Item was changed: > ----- Method: SecureSocket>>sslConnectTo: (in category 'connect') ----- > sslConnectTo: serverName > "Perform the SSL client handshake. This method uses all the common SocketStream methods to adhere to the various timeout/signalling settings of SocketStream. It only installs the SSL instance after the handshake is complete. If serverName is not nil, then try to use it for SNI." > > | inbuf squeakSSL result | > inbuf := ''. > squeakSSL := SqueakSSL new. > serverName ifNotNil: [ squeakSSL serverName: serverName ]. > "Perform the SSL handshake" > [[result := squeakSSL connect: inbuf from: 1 to: inbuf size into: sendBuf. > + > + "Check for errors first" > + result < -1 ifTrue: [^ self error: 'SSL connect failed with code: ', result]. > + > + "If a token has been produced in the handshake, send it to the remote" > + result > 0 ifTrue: [self sendData: (sendBuf copyFrom: 1 to: result)]. > + > + squeakSSL isConnected] whileFalse: [ > - result = 0] whileFalse:[ > - "Check for errors first" > - result < -1 ifTrue:[^self error: 'SSL connect failed with code: ', result]. > - > - "If a token has been produced in the handshake, send it to the remote" > - result > 0 ifTrue:[self sendData: (sendBuf copyFrom: 1 to: result)]. > - > "Read more input and repeat" > inbuf := self receiveData. > ]. > "We are connected. From here on, encryption will take place." > ssl := squeakSSL. > ] ifCurtailed:[ > "Make sure we destroy the platform handle if the handshake gets interrupted" > squeakSSL destroy. > ]. > ! > > Item was changed: > ----- Method: SecureSocketStream>>sslConnectTo: (in category 'initialize') ----- > sslConnectTo: serverName > "Perform the SSL client handshake. This method uses all the common SocketStream methods to adhere to the various timeout/signalling settings of SocketStream. It only installs the SSL instance after the handshake is complete. If serverName is not nil, then try to use it for SNI." > > | inbuf squeakSSL result | > inbuf := ''. > squeakSSL := SqueakSSL new. > serverName ifNotNil: [ squeakSSL serverName: serverName ]. > "Perform the SSL handshake" > [[result := squeakSSL connect: inbuf from: 1 to: inbuf size into: sendBuf. > + > + "Check for errors first" > + result < -1 ifTrue: [^ self error: 'SSL connect failed with code: ', result]. > + > + "If a token has been produced in the handshake, send it to the remote" > + result > 0 ifTrue: [ > + self nextPutAll: (sendBuf copyFrom: 1 to: result). > + self flush]. > + > + squeakSSL isConnected] whileFalse: [ > - result = 0] whileFalse:[ > - "Check for errors first" > - result < -1 ifTrue:[^self error: 'SSL connect failed with code: ', result]. > - > - "If a token has been produced in the handshake, send it to the remote" > - result > 0 ifTrue:[ > - self nextPutAll: (sendBuf copyFrom: 1 to: result). > - self flush. > - ]. > - > "Read more input and repeat" > self receiveData. > inbuf := self nextAvailable. > ]. > "There should be no pending data at this point, ensure it is so. > XXXX: If you ever see this problem, please inform me." > self isInBufferEmpty ifFalse:[self error: 'Unexpected input data']. > "We are connected. From here on, encryption will take place." > ssl := squeakSSL. > ] ifCurtailed:[ > "Make sure we destroy the platform handle if the handshake gets interrupted" > squeakSSL destroy. > ]. > ! > > Item was changed: > ----- Method: SqueakSSL>>connect (in category 'convenience') ----- > connect > "Convenience API. Perform an SSL client handshake. > Raises an error if something goes wrong." > > | inbuf outbuf count result | > > inbuf := ByteArray new: 4096. > outbuf := ByteArray new: 4096. > count := 0. > > "Begin the SSL handshake" > [result := self connect: inbuf from: 1 to: count into: outbuf. > + > + "Check for errors first" > + result < -1 ifTrue: [^ self error: 'SSL connect failed with code: ', result]. > + > + "If a token has been produced in the handshake, send it to the remote" > + result > 0 ifTrue: [self writeData: outbuf count: result]. > + > + self isConnected] whileFalse: [ > - result = 0] whileFalse:[ > - "Check for errors first" > - result < -1 ifTrue:[^self error: 'SSL connect failed with code: ', result]. > - > - "If a token has been produced in the handshake, send it to the remote" > - result > 0 ifTrue:[self writeData: outbuf count: result]. > - > "Read more input and repeat" > count := self readDataInto: inbuf. > ].! > > Squeak-dev mailing list -- [email protected] > To unsubscribe send an email to [email protected] Squeak-dev mailing list -- [email protected] To unsubscribe send an email to [email protected]