Giter VIP home page Giter VIP logo

Comments (7)

cernekee avatar cernekee commented on July 19, 2024

Possibly related:

https://serverfault.com/questions/771645/openconnect-cannot-connect-to-anyconnect-vpn-group-using-g
https://quickview.cloudapps.cisco.com/quickview/bug/CSCuc16678

I wonder if the <group-access> field has the wrong value if a port number is specified. If possible, try experimenting with v7.04 of the command-line openconnect client on Linux or OSX, as that will be easier than repeatedly modifying the library and rebuilding for Android.

from ics-openconnect.

peloy avatar peloy commented on July 19, 2024

Hi Kevin,

Given that the debugs on the ASA are lacking, I set up a MitM proxy to be able to see the traffic sent by OpenConnect on Android and I think the problem is this:

OpenConnect v7.08 running on Linux sends a POST request with:

Host: vpn.example.com:4443

and

<group-access>https://vpn.example.com:4443/GROUPNAME</group-access>

in the body of the POST.

OpenConnect running on Android sends:

Host: vpn.example.com

(i.e. no port), and:

<group-access>https://vpn.example.com/GROUPNAME</group-access>

(Again, no port.)

There is only one HTTP request made by OpenConnect, and it's immediately rejected by the ASA with that "Invalid host entry. Please re-enter" response.

Is OpenConnect for Android based on OpenConnect v7.04? If so, is it too difficult to make OpenConnect for Android use OpenConnect v7.08 as it seems to be working fine on that version? I can try to identify a commit that (possibly) fixed this behavior, if that helps.

Cheers!

from ics-openconnect.

cernekee avatar cernekee commented on July 19, 2024

Is OpenConnect for Android based on OpenConnect v7.04? If so, is it too difficult to make OpenConnect for Android use OpenConnect v7.08

Some additional work will be needed to use libopenconnect 7.08 on Android. It is on my TODO list but it isn't currently a high priority. It would be helpful to understand whether this issue is something that is fixed by upgrading from 7.04 to 7.08, or if it is something specific to Android on 7.04.

from ics-openconnect.

peloy avatar peloy commented on July 19, 2024

I am pretty sure this issue will be fixed with an upgrade to a more recent OpenConnect version...

For the "<group-access>" XML node, the non-standard port is appended to the URI in auth.c:xmlpost_initial_req():

    buf_append(url_buf, "https://%s", vpninfo->hostname);
    if (vpninfo->port != 443)
            buf_append(url_buf, ":%d", vpninfo->port);

This part of the code was re-worked because it's different in v7.04:

if (vpninfo->urlpath)
	result = asprintf(&url, "https://%s/%s", vpninfo->hostname, vpninfo->urlpath);
else
	result = asprintf(&url, "https://%s", vpninfo->hostname);

(No non-standard port is appended.)

Same thing for the "Host:" HTTP header: In v7.08's cstp.c:start_cstp_connection() the code is:

    if (vpninfo->port != 443)
            buf_append(reqbuf, "Host: %s:%d\r\n", vpninfo->hostname, vpninfo->port);
    else
            buf_append(reqbuf, "Host: %s\r\n", vpninfo->hostname);

(i.e. non-standard port appended to the host.)

but in v7.04's cstp.c:start_cstp_connection() the code is simply:

buf_append(reqbuf, "Host: %s\r\n", vpninfo->hostname);

from ics-openconnect.

cernekee avatar cernekee commented on July 19, 2024

The master branch is now based on v7.08 + additional fixes. Can you retest?

Here's a debug APK, if needed:

https://storage.googleapis.com/cernekee-travis/ics-openconnect/OpenConnect-debug.apk

from ics-openconnect.

peloy avatar peloy commented on July 19, 2024

from ics-openconnect.

dlenski avatar dlenski commented on July 19, 2024

Closed per #23 (comment)

from ics-openconnect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.