Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip SSL verification when checking if the source file exists #203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion esxi/guest-create.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package esxi

import (
"bytes"
"crypto/tls"
"fmt"
"io/ioutil"
"log"
Expand Down Expand Up @@ -205,7 +206,11 @@ func guestCREATE(c *Config, guest_name string, disk_store string,
// Check if source file exist.
if strings.HasPrefix(src_path, "http://") || strings.HasPrefix(src_path, "https://") {
log.Printf("[guestCREATE] Source is URL.\n")
resp, err := http.Get(src_path)
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: tr}
resp, err := client.Get(src_path)
if (err != nil) || (resp.StatusCode != 200) {
log.Printf("[guestCREATE] URL not accessible: %s\n", src_path)
log.Printf("[guestCREATE] URL StatusCode: %d\n", resp.StatusCode)
Expand Down