This also adds the API function to the Java bindings.
The immediate motivation is that there are a lot of Android users with
MTU-related issues (https://github.com/cernekee/ics-openconnect), and
disabling UDP/DTLS/ESP is a good temporary band-aid.
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
public synchronized native int setAllowInsecureCrypto(boolean isEnabled);
public synchronized native void setSystemTrust(boolean isEnabled);
public synchronized native int setProtocol(String protocol);
+ public synchronized native void disableDTLS();
+ public synchronized native void disableIPv6();
/* connection info */
openconnect_disable_ipv6(ctx->vpninfo);
}
+JNIEXPORT void JNICALL Java_org_infradead_libopenconnect_LibOpenConnect_disableDTLS(
+ JNIEnv *jenv, jobject jobj)
+{
+ struct libctx *ctx = getctx(jenv, jobj);
+
+ if (!ctx)
+ return;
+ openconnect_disable_dtls(ctx->vpninfo);
+}
+
JNIEXPORT void JNICALL Java_org_infradead_libopenconnect_LibOpenConnect_setCertExpiryWarning(
JNIEnv *jenv, jobject jobj, jint arg)
{
openconnect_set_cookie;
openconnect_set_allow_insecure_crypto;
openconnect_get_auth_expiration;
+ openconnect_disable_dtls;
} OPENCONNECT_5_6;
OPENCONNECT_PRIVATE {
vpninfo->disable_ipv6 = 1;
}
+void openconnect_disable_dtls(struct openconnect_info *vpninfo)
+{
+ vpninfo->dtls_state = DTLS_DISABLED;
+}
+
int openconnect_set_cafile(struct openconnect_info *vpninfo, const char *cafile)
{
UTF8CHECK(cafile);
* - Add openconnect_set_cookie()
* - Add openconnect_set_allow_insecure_crypto()
* - Add openconnect_get_auth_expiration()
+ * - Add openconnect_disable_dtls()
*
* API version 5.6 (v8.06; 2020-03-31):
* - Add openconnect_set_trojan_interval()
void openconnect_clear_cookie(struct openconnect_info *);
void openconnect_disable_ipv6(struct openconnect_info *vpninfo);
+void openconnect_disable_dtls(struct openconnect_info *vpninfo);
void openconnect_reset_ssl(struct openconnect_info *vpninfo);
int openconnect_parse_url(struct openconnect_info *vpninfo, const char *url);
void openconnect_set_cert_expiry_warning(struct openconnect_info *vpninfo,