Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions android/src/main/java/org/conscrypt/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,12 @@ private static void setSSLParametersOnImpl(SSLParameters params, SSLParametersIm
Method m_getUseCipherSuitesOrder = params.getClass().getMethod("getUseCipherSuitesOrder");
impl.setUseCipherSuitesOrder((boolean) m_getUseCipherSuitesOrder.invoke(params));

Method getNamedGroupsMethod = params.getClass().getMethod("getNamedGroups");
impl.setNamedGroups((String[]) getNamedGroupsMethod.invoke(params));
try {
Method getNamedGroupsMethod = params.getClass().getMethod("getNamedGroups");
impl.setNamedGroups((String[]) getNamedGroupsMethod.invoke(params));
} catch (NoSuchMethodException | IllegalArgumentException e) {
// Do nothing.
}
}

public static void setSSLParameters(
Expand Down Expand Up @@ -327,8 +331,13 @@ private static void getSSLParametersFromImpl(SSLParameters params, SSLParameters
params.getClass().getMethod("setUseCipherSuitesOrder", boolean.class);
m_setUseCipherSuitesOrder.invoke(params, impl.getUseCipherSuitesOrder());

Method setNamedGroupsMethod = params.getClass().getMethod("setNamedGroups", String[].class);
setNamedGroupsMethod.invoke(params, (Object[]) impl.getNamedGroups());
try {
Method setNamedGroupsMethod =
params.getClass().getMethod("setNamedGroups", String[].class);
setNamedGroupsMethod.invoke(params, (Object) impl.getNamedGroups());
} catch (NoSuchMethodException | IllegalArgumentException e) {
// Do nothing.
}
}

public static void getSSLParameters(
Expand Down
34 changes: 26 additions & 8 deletions platform/src/main/java/org/conscrypt/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,12 @@ static void setSSLParameters(
impl.setEndpointIdentificationAlgorithm(params.getEndpointIdentificationAlgorithm());
impl.setUseCipherSuitesOrder(params.getUseCipherSuitesOrder());

Method getNamedGroupsMethod = params.getClass().getMethod("getNamedGroups");
impl.setNamedGroups((String[]) getNamedGroupsMethod.invoke(params));
try {
Method getNamedGroupsMethod = params.getClass().getMethod("getNamedGroups");
impl.setNamedGroups((String[]) getNamedGroupsMethod.invoke(params));
} catch (NoSuchMethodException | IllegalArgumentException e) {
// Do nothing.
}

List<SNIServerName> serverNames = params.getServerNames();
if (serverNames != null) {
Expand All @@ -187,8 +191,13 @@ static void getSSLParameters(
params.setEndpointIdentificationAlgorithm(impl.getEndpointIdentificationAlgorithm());
params.setUseCipherSuitesOrder(impl.getUseCipherSuitesOrder());

Method setNamedGroupsMethod = params.getClass().getMethod("setNamedGroups", String[].class);
setNamedGroupsMethod.invoke(params, (Object[]) impl.getNamedGroups());
try {
Method setNamedGroupsMethod =
params.getClass().getMethod("setNamedGroups", String[].class);
setNamedGroupsMethod.invoke(params, (Object) impl.getNamedGroups());
} catch (NoSuchMethodException | IllegalArgumentException e) {
// Do nothing.
}

if (impl.getUseSni() && AddressUtils.isValidSniHostname(socket.getHostname())) {
params.setServerNames(Collections.<SNIServerName>singletonList(
Expand All @@ -202,8 +211,12 @@ static void setSSLParameters(
impl.setEndpointIdentificationAlgorithm(params.getEndpointIdentificationAlgorithm());
impl.setUseCipherSuitesOrder(params.getUseCipherSuitesOrder());

Method getNamedGroupsMethod = params.getClass().getMethod("getNamedGroups");
impl.setNamedGroups((String[]) getNamedGroupsMethod.invoke(params));
try {
Method getNamedGroupsMethod = params.getClass().getMethod("getNamedGroups");
impl.setNamedGroups((String[]) getNamedGroupsMethod.invoke(params));
} catch (NoSuchMethodException | IllegalArgumentException e) {
// Do nothing.
}

List<SNIServerName> serverNames = params.getServerNames();
if (serverNames != null) {
Expand All @@ -222,8 +235,13 @@ static void getSSLParameters(
params.setEndpointIdentificationAlgorithm(impl.getEndpointIdentificationAlgorithm());
params.setUseCipherSuitesOrder(impl.getUseCipherSuitesOrder());

Method setNamedGroupsMethod = params.getClass().getMethod("setNamedGroups", String[].class);
setNamedGroupsMethod.invoke(params, (Object[]) impl.getNamedGroups());
try {
Method setNamedGroupsMethod =
params.getClass().getMethod("setNamedGroups", String[].class);
setNamedGroupsMethod.invoke(params, (Object) impl.getNamedGroups());
} catch (NoSuchMethodException | IllegalArgumentException e) {
// Do nothing.
}

if (impl.getUseSni() && AddressUtils.isValidSniHostname(engine.getHostname())) {
params.setServerNames(Collections.<SNIServerName>singletonList(
Expand Down
Loading