add -insecure flag and relevant tests