Skip to Content
0
Former Member
Jul 21, 2016 at 10:53 AM

Encrypt password to connect Sybase from Perl script

1226 Views

I'm using the "check_sybase" script from Nagios repository to monitorize a Sybase DB.

The problem comes when that Sybase requires to encrypt the password on the network.

I'm using DBD::Sybase as driver to connect with DBI to Sybase. I've checked the documentation of this module and specifies that "encryptPassword=1" on the connection string would be enough. But it does not work. Here my connection string:

$dbh = DBI->connect("dbi:Sybase:encryptPassword=1;server=$dbsvr;database=$dbname;".
                "charset=$charset;timeout=$timeout;".
        "loginTimeout=$timeout", $user, $pass)
  or &ncrit("Could not connect to '$dbname' on '$dbsvr'");

And the error message: Adaptive Server requires encryption of the login password on the network.

  DBI connect('encryptPassword=1;server=XX;database=XX;charset=iso_1;timeout=15;loginTimeout=15','XX',...) failed:
Server message number=1640 severity=16 state=2 line=0 server=XX text=
Adaptive Server requires encryption of the login password on the network.
Server message number=4002 severity=14 state=1 line=0 server=XX text=Login failed.
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (34)Server XX, database Message String:
Adaptive Server connection failed

No idea on how to solve this.

Moreover, when I connect via isql with the command "-X" works fine.

Pd: I can only connect to those DB which don't require password encryption. I know that this attribute can be modified.