@@ -43,6 +43,8 @@ public class WolfSSLParametersHelper
4343 private static Method setSNIMatchers = null ;
4444 private static Method getMaximumPacketSize = null ;
4545 private static Method setMaximumPacketSize = null ;
46+ private static Method setUseCipherSuitesOrder = null ;
47+ private static Method getUseCipherSuitesOrder = null ;
4648
4749 /** Default WolfSSLParametersHelper constructor */
4850 public WolfSSLParametersHelper () { }
@@ -91,6 +93,12 @@ public Object run() {
9193 case "setMaximumPacketSize" :
9294 setMaximumPacketSize = m ;
9395 continue ;
96+ case "setUseCipherSuitesOrder" :
97+ setUseCipherSuitesOrder = m ;
98+ continue ;
99+ case "getUseCipherSuitesOrder" :
100+ getUseCipherSuitesOrder = m ;
101+ continue ;
94102 default :
95103 continue ;
96104 }
@@ -134,7 +142,8 @@ protected static SSLParameters decoupleParams(WolfSSLParameters in) {
134142 * do not existing in older JDKs. Since older JDKs will not have them,
135143 * use Java reflection to detect availability in helper class. */
136144 if (setServerNames != null || setApplicationProtocols != null ||
137- setEndpointIdentificationAlgorithm != null || setSNIMatchers != null ) {
145+ setEndpointIdentificationAlgorithm != null ||
146+ setSNIMatchers != null || setUseCipherSuitesOrder != null ) {
138147
139148 try {
140149 /* load WolfSSLJDK8Helper at runtime, not compiled
@@ -167,6 +176,11 @@ protected static SSLParameters decoupleParams(WolfSSLParameters in) {
167176 mth = cls .getDeclaredMethod ("setSNIMatchers" , paramList );
168177 mth .invoke (obj , ret , setSNIMatchers , in );
169178 }
179+ if (setUseCipherSuitesOrder != null ) {
180+ mth = cls .getDeclaredMethod ("setUseCipherSuitesOrder" ,
181+ paramList );
182+ mth .invoke (obj , ret , setUseCipherSuitesOrder , in );
183+ }
170184
171185 } catch (Exception e ) {
172186 /* ignore, class not found */
@@ -193,15 +207,20 @@ protected static SSLParameters decoupleParams(WolfSSLParameters in) {
193207 /* Not available, just ignore and continue */
194208 }
195209
210+ try {
211+ if (setUseCipherSuitesOrder != null ) {
212+ ret .setUseCipherSuitesOrder (in .getUseCipherSuitesOrder ());
213+ }
214+ } catch (Exception e ) {
215+ /* Not available, just ignore and continue */
216+ }
217+
196218 /* The following SSLParameters features are not yet supported
197219 * by wolfJSSE (see Android API 23 note above). They are supported
198220 * with newer versions of SSLParameters, but will need to be added
199221 * conditionally to wolfJSSE when supported. */
200222 /*ret.setAlgorithmConstraints(in.getAlgorithmConstraints());
201223 ret.setEnableRetransmissions(in.getEnableRetransmissions());
202- ret.setMaximumPacketSize(in.getMaximumPacketSize());
203- ret.setSNIMatchers(in.getSNIMatchers());
204- ret.setUseCipherSuitesOrder(in.getUseCipherSuitesOrder());
205224 */
206225
207226 return ret ;
@@ -242,7 +261,8 @@ protected static void importParams(SSLParameters in,
242261 * do not existing in older JDKs. Since older JDKs will not have them,
243262 * use Java reflection to detect availability in helper class. */
244263 if (getServerNames != null || getApplicationProtocols != null ||
245- getEndpointIdentificationAlgorithm != null || getSNIMatchers != null ) {
264+ getEndpointIdentificationAlgorithm != null ||
265+ getSNIMatchers != null || getUseCipherSuitesOrder != null ) {
246266 try {
247267 /* load WolfSSLJDK8Helper at runtime, not compiled on older JDKs */
248268 Class <?> cls = Class .forName (
@@ -267,10 +287,15 @@ protected static void importParams(SSLParameters in,
267287 "getEndpointIdentificationAlgorithm" , paramList );
268288 mth .invoke (obj , in , out );
269289 }
270- if (getSNIMatchers != null ){
290+ if (getSNIMatchers != null ) {
271291 mth = cls .getDeclaredMethod ("getSNIMatchers" , paramList );
272292 mth .invoke (obj , in , out );
273293 }
294+ if (getUseCipherSuitesOrder != null ) {
295+ mth = cls .getDeclaredMethod ("getUseCipherSuitesOrder" ,
296+ paramList );
297+ mth .invoke (obj , in , out );
298+ }
274299
275300 } catch (Exception e ) {
276301 /* ignore, class not found */
@@ -296,12 +321,21 @@ protected static void importParams(SSLParameters in,
296321 * conditionally to wolfJSSE when supported. */
297322 /*out.setAlgorithmConstraints(in.getAlgorithmConstraints());
298323 out.setEnableRetransmissions(in.getEnableRetransmissions());
299- out.setMaximumPacketSize(in.getMaximumPacketSize());
300- out.setSNIMatchers(in.getSNIMatchers());
301- out.setUseCipherSuitesOrder(in.getUseCipherSuitesOrder());
302324 */
303325
304- out .setSNIMatchers (in .getSNIMatchers ());
326+ try {
327+ out .setSNIMatchers (in .getSNIMatchers ());
328+ } catch (Exception e ) {
329+ /* Not available, just ignore and continue */
330+ }
331+
332+ try {
333+ if (getUseCipherSuitesOrder != null ) {
334+ out .setUseCipherSuitesOrder (in .getUseCipherSuitesOrder ());
335+ }
336+ } catch (Exception e ) {
337+ /* Not available, just ignore and continue */
338+ }
305339
306340 }
307341}
0 commit comments