Skip to content

Commit

Permalink
feat: added local and remote certificate getter to DataChannel and Sctp
Browse files Browse the repository at this point in the history
  • Loading branch information
lchenut committed Oct 30, 2024
1 parent 4659924 commit d1cf6ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webrtc/datachannel.nim
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,9 @@ proc new*(_: type DataChannelConnection, conn: SctpConn, isServer: bool): DataCh
streamId: if isServer: 1'u16 else: 2'u16,
)
result.readLoopFut = result.readLoop()

proc localCertificate*(self: DataChannelConnection): seq[byte] =
self.conn.localCertificate()

proc remoteCertificate*(self: DataChannelConnection): seq[byte] =
self.conn.remoteCertificate()
6 changes: 6 additions & 0 deletions webrtc/sctp/sctp_connection.nim
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,9 @@ proc close*(self: SctpConn) {.async: (raises: [CancelledError, WebRtcError]).} =
for onCloseProc in self.onClose:
onCloseProc()
self.onClose = @[]

proc localCertificate*(self: SctpConn): seq[byte] =
self.conn.localCertificate()

proc remoteCertificate*(self: SctpConn): seq[byte] =
self.conn.remoteCertificate()

0 comments on commit d1cf6ea

Please sign in to comment.