Git Product home page Git Product logo

Comments (2)

davidhcefx avatar davidhcefx commented on July 3, 2024

Same here!
Works fine when done manually, but failed when using this tool:

$ echo -e "y\n${USER}\n${PASSWORD}" | "/path/to/Cisco AnyConnect Secure Mobility Client/vpncli.exe" connect ${URL} -s
Cisco AnyConnect Secure Mobility Client (version 4.8.01090) .

Copyright (c) 2004 - 2019 Cisco Systems, Inc.  All Rights Reserved.


  >> state: Disconnected
  >> state: Disconnected
  >> notice: Ready to connect.
  >> registered with local VPN subsystem.
  >> contacting host (<SERVER>) for login information...
  >> notice: Contacting <SERVER>.
AnyConnect cannot verify server: <SERVER>
    - Certificate does not match the server name.
    - Certificate is from an untrusted source.
    - Certificate has an invalid date.
Connecting to this server may result in a severe security compromise!

Most users do not connect to untrusted servers unless the reason for the error condition is known.

Connect Anyway? [y/n]:
  >> Please enter your username and password.
.....
  >> notice: Establishing VPN...
  >> state: Connected

@hacki11, Looks like line 20 is the culprit:

def connect(self, url: str, user: str, password: str, autorespond: bool = False):
logging.info(f"Connecting to '{url}' as '{user}'")
proc = Popen([self.bin, "connect", url, "-s"], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
answer = "y\n" if autorespond else ""
stdout = proc.communicate(input=f"{user}\n{password}\n{answer}".encode())[0]
logging.debug(stdout.decode())
proc.wait()

from cisco-anyconnect-cli.

hacki11 avatar hacki11 commented on July 3, 2024

fixed with #9

from cisco-anyconnect-cli.

Related Issues (5)

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.