Once the user is in the secure subdomain I change the WP_SITEURL to https (If not, the css and js will not work).
The problem is that when I set it to https, WordPress shows me HTTP instead of HTTPS on all the urls generated with bloginfo().

I tried this using an older version of WordPress and didn’t have any issues. The problem begins in 3.6+.