cernekee / ics-openconnect

Android UI for OpenConnect VPN client
GNU General Public License v2.0
358 stars 129 forks source link

How can I get DTLSCompression and an DTLSCipher information #67

Closed wannaliang closed 1 year ago

wannaliang commented 3 years ago

I can go through ipinfo.DTLSOptions Access to x-dtls and other information, but I did not find an effective way to obtain the protocol and other information, whether someone can guide you, thanks

dlenski commented 3 years ago

I can go through ipinfo.DTLSOptions Access to x-dtls and other information

Don't do this. The CSTPOptions and DTLSOptions are Cisco-specific and even verison-of-Cisco-server-specific and will break if you're using any other protocol supported by OpenConnect.

(They really shouldn't be in the publicly-visible API at all.)

I did not find an effective way to obtain the protocol and other information

If you're looking for compression and cipher information, then https://gitlab.com/openconnect/openconnect/-/blob/master/java/src/org/infradead/libopenconnect/LibOpenConnect.java#L164-167

wannaliang commented 3 years ago

Thank you very much for your answer. But I really need that information.I have also looked at libopenconnect.java. But I didn't find a valid way to call such a method as getCSTPCipher, as if the method had no method in the JAR package to call the value. I saw a display of the log information, but I couldn't find where it came from

cernekee commented 3 years ago

Can you call mOC.getCSTPCipher()? It should work the same way as the other JNI methods.

I saw a display of the log information

Most of the log messages are generated internally by the C code in libopenconnect, so they can potentially contain information that isn't accessible through the Java bindings. If there is something that's important for the caller to have, the upstream openconnect project might accept library API changes (I had to add a bunch of new APIs to support the Android port).

wannaliang commented 3 years ago

I've tried using moc.getCstpcipher to get this value, but I've got nothing. I've also tried calling this method in OpenConnectManagementThread.java but it's still empty, and I'm not sure if I can't get the value or if there's something wrong with my calling method

dlenski commented 3 years ago

@wannaliang Ensure you are using LibOpenConnect v8.06+ or newer. I did a bunch of bugfixes to the ciphersuite library functions, in particular in https://gitlab.com/openconnect/openconnect/-/commit/dd4693b6058f674671c1f705b55333e5a6c6c8d5 and a few subsequent commits.

wannaliang commented 3 years ago

Ok, I will update the latest version and try, thank you very much for your help