It's not really a grep problem, per se.
Code:
sed -n 's/-ssl$//p' test.txt | fgrep -vxf - test.txt
This finds all the -ssl lines, and removes the -ssl suffix, then removes any lines matching any of these lines (-ssl lines with the -ssl suffix removed) from the original file.