My Grails app runs over HTTPS and in Config.groovy I've set:
environments { development { grails.serverURL = "https://localhost:8443/foo" } } When I execute grails run-app to start the app in dev mode, the last message printed on the console is:
Server running. Browse to
http://localhost:8082/foo
If I accidentally click on this URL to access the application, I get various errors due to the same-origin security policy (because https://localhost:8443 is a different host to http://localhost:8082).
Why is Grails prompting me to access my app via http://localhost:8082/foo when I've set grails.serverURL = "https://localhost:8443/foo"
Update
I changed the startup command to grails run-app -https and the last message printed on the console is now:
Server running. Browse to
http://localhost:8082/fooorhttps://localhost:8443/foo
Why am I given the option of either HTTP or HTTPS, rather than just the latter? Also, I get this exception during startup:
http11.Http11Protocol Failed to initialize end point associated with ProtocolHandler ["http-bio-8443"] java.net.BindException: Address already in use <null>:8443 at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:407) I've checked if port 8443 is in use before I run this command (it isn't), but the server seems to startup despite this exception, so this is not a major concern.