Force HTTPS with Zend Framework 2

My latest project authenticates my user’s using their Active Directory credentials, I didn’t want them submitting their username and password through an unencrypted connection. I’m just learning Zend Framework, but the simplest solution to this problem seemed to be to create a reusable module that would automatically force all communication through an HTTPS connection.  I adapted the code from this submission on GitHub, removed a bunch of unnecessary code.  You can copy and paste this module into any ZFW 2.0 project, just remember to enable it in your application.config.php.