Default to first supported group as key_share
@@ -272,8 +272,10 @@ public Hashtable getClientExtensions()
public Vector getEarlyKeyShareGroups()
{
- if (null != supportedGroups)
+ if (null == supportedGroups || supportedGroups.isEmpty())
{
+ return null;
+ }
if (supportedGroups.contains(Integers.valueOf(NamedGroup.x25519)))
{
return TlsUtils.vectorOfOne(Integers.valueOf(NamedGroup.x25519));
@@ -282,8 +284,7 @@ public Vector getEarlyKeyShareGroups()
{
return TlsUtils.vectorOfOne(Integers.valueOf(NamedGroup.secp256r1));
}
- }
- return null;
+ return TlsUtils.vectorOfOne(supportedGroups.elementAt(0));
}
public void notifyServerVersion(ProtocolVersion serverVersion)
