Crawling www.mydomain.com (Drupal 7 site) but links are indexed as http://mydomain.com (without the www). Why?

I’m testing Swiftype for a Drupal 7 site, and I’m having a problem where even though I’m asking to crawl https://www.mydomain.com, some of the pages being indexed are showing http://mydomain.com/the/page/ as their URL in the search results. The protocol is wrong (http instead of https) and so is the domain prefix. Why is it doing so and what should I change to fix it? Is this a Drupal thing?

The site is only using a robots.txt file to restrict the crawling to certain areas, and does not have a sitemap.xml file.