<div dir="ltr">Hi Tim,<div>Thanks for the info! Some comments below:</div><div>- It is possible to inject and receive DTLS packets via a socket interface. However, demultiplexing of incoming packets is not supported.</div><div>- Use_srtp extension is not implemented. Key material extraction is not supported either.</div><div>- Certificate verification is possible using a custom X509TrustManager; the certificate can also be verified by the application after the handshake.</div><div>- Timeouts are managed by the application. Most DTLS handshake packets can be retransmitted on demand, but see <a class="gmail-issue-link" href="https://bugs.openjdk.org/browse/JDK-8263571" id="gmail-key-val" rel="5043897" style="font-family:"DejaVu Sans",sans-serif;font-size:14px;color:rgb(0,82,204)">JDK-8263571</a>.</div><div><br></div><div>Cheers,</div><div>Daniel</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">pt., 8 mar 2024 o 10:56 Tim Panton <<a href="mailto:thp@westhawk.co.uk">thp@westhawk.co.uk</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br id="m_-2313124722335719022lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On 8 Mar 2024, at 07:47, Daniel Jeliński <<a href="mailto:djelinski1@gmail.com" target="_blank">djelinski1@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div dir="ltr">Hi Paul,</div><div>If you're interested in dealing with handshake extensions from user code, that is currently not possible. SSLEngine abstracts away all TLS messaging. SSLParameters can be used to configure a limited subset of extensions to send (like server_name or application protocol), and the negotiated application protocol can be retrieved from SSLEngine, and that's pretty much it.</div><div><br></div><div>Use_srtp extension is not currently supported by JSSE. If you want to add that support, you'd need to add the appropriate enum values to sun.security.ssl.SSLExtension, using the constructors that specify a producer and a consumer. I'm not familiar with WebRTC or SRTP, so I don't know how that would interact with the rest of the code.</div><div><br></div><div>If you have an idea how WebRTC / SRTP support could be implemented in JSSE, this is the right place for that discussion.</div><div><br></div><div>Regards,</div><div>Daniel</div></div>
</div></blockquote></div><br><div>Daniel, hi, following up on Paul’s question… </div><div><br></div><div>I've done an integration with BouncyCastle DTLS API with WebRTC’s SRTP (and indirectly paid for the api to exist), here’s what I remember was needed:</div><div><br></div><div>1) Ability to inject and receive DTLS packets via a socket-like interface</div><div><span style="white-space:pre-wrap">      </span>- WebRTC muxes several protocols onto the same 5tuple ports so we need to manage the packet traffic from a UDP socket before it gets to DTLS. </div><div><span style="white-space:pre-wrap">  </span>- In some cases the DTLS packet is wrapped in a TURN packet on the wire - so you cant’t even assume the packet came in on UDP.</div><div>2) Ability to set and detect the use_srtp Extension</div><div>3) Ability to verify the self signed cert offered in the handshake</div><div>4) Ability to manage the handshake timeouts </div><div>5) Ability to extract the keyring material post handshake</div><div><br></div><div>I haven’t kept up with JSSE DTLS but I don’t remember any of those API points being available.</div><div><br></div><div>It would be nice to be able to use JDK/JSSE but to be honest I’m pretty happy with BouncyCastle.</div><div><br></div><div>There is an example of our use here :</div><div><div style="display:block"><div style="display:inline-block" role="link"><a style="border-radius:10px;font-family:-apple-system,Helvetica,Arial,sans-serif;display:block;width:300px;overflow:hidden;text-decoration:none" rel="nofollow" href="https://github.com/pipe/whipi/blob/d0fe6c06f5b34fa832d1ebce0bd228f066920da0/src/main/java/pe/pi/whipi/DTLS.java" dir="ltr" role="button" width="300" target="_blank"><table style="table-layout:fixed;border-collapse:collapse;width:300px;background-color:rgb(229,230,233);font-family:-apple-system,Helvetica,Arial,sans-serif" cellpadding="0" cellspacing="0" border="0" width="300"><tbody><tr><td align="center"><img style="width: 300px; height: 150px;" width="300" height="150" alt="whipi.png" src="cid:ii_18e41b38e4796b5266c1"></td></tr><tr><td><table bgcolor="#E5E6E9" cellpadding="0" cellspacing="0" width="300" style="font-family:-apple-system,Helvetica,Arial,sans-serif;table-layout:fixed;background-color:rgb(229,230,233)"><tbody><tr><td style="padding:8px 0px"><div style="max-width:100%;margin:0px 16px;overflow:hidden"><div style="font-weight:500;font-size:12px;overflow:hidden;text-overflow:ellipsis;text-align:left"><a rel="nofollow" href="https://github.com/pipe/whipi/blob/d0fe6c06f5b34fa832d1ebce0bd228f066920da0/src/main/java/pe/pi/whipi/DTLS.java" style="text-decoration:none" target="_blank"><font color="#272727" style="color:rgba(0,0,0,0.847)">whipi/src/main/java/pe/pi/whipi/DTLS.java at d0fe6c06f5b34fa832d1ebce0bd228f066920da0 · pipe/whipi</font></a></div><div style="font-weight:400;font-size:11px;overflow:hidden;text-overflow:ellipsis;text-align:left"><a rel="nofollow" href="https://github.com/pipe/whipi/blob/d0fe6c06f5b34fa832d1ebce0bd228f066920da0/src/main/java/pe/pi/whipi/DTLS.java" style="text-decoration:none" target="_blank"><font color="#808080" style="color:rgba(0,0,0,0.498)">github.com</font></a></div></div></td></tr></tbody></table></td></tr></tbody></table></a></div></div></div><div> </div></div></blockquote></div>