If you need to frequently perform client-authentication to a Checkpoint Firewall-1 via HTTPS, this can be scripted thusly:
#!/bin/sh
export USERID=your_userid
export ENCPWD=your_password
export NGWID=`curl -k https://firewall-1/ | grep ID | cut -d\" -f6`
curl -k --data "ID=$NGWID&STATE=1&DATA=$USERID" https://firewall-1/
curl -k --data "ID=$NGWID&STATE=2&DATA=$ENCPWD" https://firewall-1/
curl -k --data "ID=$NGWID&STATE=3&DATA=1" https://firewall-1/
Note that your ENCPWD needs to be URI escaped if it contains special characters. If you have the Perl module URI::Escape installed you can do this with:
export ENCPWD=`perl -MURI::Escape -e "print uri_escape('your_password')"`
If the firewall requires a password based on a RSA token then insert the following:
echo -n "Enter key: "; read xx
echo "Thanks"
export ENCPWD=`perl -MURI::Escape -e "print uri_escape('$xx')"`
[robg adds: I haven't tested this one...]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20031227064333804