You have to have the package libssl-dev installed before configuring and compiling python from the tarball:
sudo apt-get install libssl-dev
cd YOUR_PYTHON_2.5_1_SRC_DIR
make clean
./configure
make
sudo make install
Do you have a good reason not to use the latest version in the 2.5.X series?