To use SSL, first the web site needs to support it. Normally, for each provider, you search for POP and IMAP support and look up what they tell you to do (what servers you need to use) to access them
So, for instance, if you are using SSL and POP on pop.example.com, and it says use port 998, then you need to fetch the SSL finger print using
openssl s_client -connect pop.example.com:995 -showcerts | openssl x509 -fingerprint -noout -md5
If you are using SSL and IMAP in map.mail.example.com and it says use port 993, then the command is
openssl s_client -connect map.mail.example.com:993 -showcerts | openssl x509 -fingerprint -noout -md5
Then you need to set up fetchmailrc appropriately.
So, if you were using POP, on Yahoo, and your Yahoo account was ME_YAHOO with password PASSW0RD and you want mail delivered to REAL_ME on the server, it looks something like:
poll Yahoo
proto pop3
auth password
via pop.mail.yahoo.com
user "ME_YAHOO"
pass "PASSW0RD"
smtpname REAL_ME
ssl
sslfingerprint '11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00'
smtp /var/run/dovecot/lmtp
If you were using IMAP on example.com it might look like
poll Example
proto imap
via imap.mail.example.com
user "ME_YAHOO"
pass "PASSW0RD"
smtpname REAL_ME
sslfingerprint '11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00'
smtp /var/run/dovecot/lmtp
You may or may not need the ssl keyword, and the auth password. You need to tune for each server.