JavaScript: fix SSL endpoints

The secure context URLs weren't being passed down properly.