Skip to content

Commit 865531f

Browse files
committed
Clearify when it's safe to set protos in SSLContext javadocs
Motivation: We should make it clear when it safe to call the various SSLContext.set*(...) methods that configure protos to use. Modifications: - Enhance javadocs Result: Ensure people are aware that these callbacks need to be configure before the SSLContext is used to create SSL objects
1 parent a879c85 commit 865531f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎openssl-classes/src/main/java/io/netty/internal/tcnative/SSLContext.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,9 @@ private static byte[] protocolsToWireFormat(String[] protocols) {
587587

588588
/**
589589
* Set next protocol for next protocol negotiation extension
590+
* <p>
591+
* <strong>Important: This method must only be called before any SSL object was created and used
592+
* that belongs to this context. Failing to do so results in undefined behaviour.</strong>
590593
* @param ctx Server context to use.
591594
* @param nextProtos protocols in priority order
592595
* @param selectorFailureBehavior see {@link SSL#SSL_SELECTOR_FAILURE_NO_ADVERTISE}
@@ -600,6 +603,9 @@ public static void setNpnProtos(long ctx, String[] nextProtos, int selectorFailu
600603

601604
/**
602605
* Set application layer protocol for application layer protocol negotiation extension
606+
* <p>
607+
* <strong>Important: This method must only be called before any SSL object was created and used
608+
* that belongs to this context. Failing to do so results in undefined behaviour.</strong>
603609
* @param ctx Server context to use.
604610
* @param alpnProtos protocols in priority order
605611
* @param selectorFailureBehavior see {@link SSL#SSL_SELECTOR_FAILURE_NO_ADVERTISE}

0 commit comments

Comments
 (0)