question: private static SupportedGroup negotiateNamedCurve ( ClientHello clientHello ) { SupportedGroup result = null ; List < SupportedGroup > preferredGroups = SupportedGroup . getPreferredGroups ( ) ; SupportedEllipticCurvesExtension extension = clientHello . getSupportedEllipticCurvesExtension ( ) ; if ( extension == null ) { if ( ! preferredGroups . isEmpty ( ) ) { result = preferredGroups . get ( 0 ) ; } } else { for ( Integer preferredGroupId : extension . getSupportedGroupIds ( ) ) { SupportedGroup group = SupportedGroup . fromId ( preferredGroupId ) ; if ( group != null && group . isUsable ( ) && preferredGroups . contains ( group ) ) { result = group ; break ; } } } return result ; }
target:  Determines the elliptic curve to use during the EC based DH key exchange.