Some guesses:
- Different CA cert bundles between windows box and AWS.
- Connection disallowed by AWS policy.
- Connection disallowed by Gmail policy.
- Different versions of perl between windows box and AWS.
- Different versions of the modules between windows box and AWS.
- Different versions of openssl between windows box and AWS.
Personally I would try to make the connection by hand, outside of perl using openssl's handy s_client command. If that fails then you know it's nothing to do with perl.