There is quite a lot of use of the BLOG_BASEURL constant in the code, instead of the $fp_config['general]['www'] variable. This is what causes the problem. The constant is defined much earlier in the code than the configuration settings files is loaded. The constant is also set to the HTTP_HOST value using the HTTP protocol.
What I did was change the defaults.php file to use https instead of http on the line that defines BLOG_BASEURL. I still don't like how this is done, but to fix it properly and force the base URL to be the same as the configured Blog URL would take more effort. I also defined a new constant BLOG_HTTPS_START_DT which specifies when SSL was enabled on the blog, more on this further down.
Here's the code I have:
Now to explain the new constant I've defined. This specifies when the SSL switch-over happened and is required so that any URLs that the Pretty URLs plugin generates use the correct protocol to avoid breaking the social media links. I've noticed that my older blog posts 'lost' their Facebook likes if I used the https URL in the data-ref attribute for the like button, so this is a workaround for that. It was a similar situation for Google Plus and Twitter buttons.
To get that to work, I've replaced the permalink() function in plugin.prettyurls.php with the following:
In my new function, I check if the date of the blog post is before or on the SSL switch-over date and change the URL to http if it is. This makes all the social media URLs revert to the old pre-SSL links.
The same change should be done for static page links too, but since those do not use the date of the static page, there is nothing to compare against. I left these as is for now, but may return to fix them too.
The last bit that needs to happen is to change the Blog URL in the Admin Options screen since that is used in some places too.