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

Certificate for source may not be signed for loopback #89

Open
nelio2k opened this issue Dec 19, 2023 · 0 comments
Open

Certificate for source may not be signed for loopback #89

nelio2k opened this issue Dec 19, 2023 · 0 comments

Comments

@nelio2k
Copy link
Member

nelio2k commented Dec 19, 2023

	// Only grab certificate if on a loopback device
	if difftool.specifiedRef.IsHttps() && isURLLoopBack(options.sourceUrl) {
		cert, err := utils.GetCertificate(difftool.utils, options.sourceUrl, options.sourceUsername,
			options.sourcePassword, xdcrBase.HttpAuthMechPlain)
		if err != nil {
			return err
		}

		internalHttpsHostname, _, err := difftool.utils.HttpsRemoteHostAddr(options.sourceUrl, nil)
		if err != nil {
			return fmt.Errorf("unable to get httpsRemoteHostAddr: %v", err)
		}

		difftool.selfRef.Certificate_ = cert
		refHttpAuthMech, defaultPoolInfo, _, err := difftool.utils.GetSecuritySettingsAndDefaultPoolInfo(options.sourceUrl,
			internalHttpsHostname, difftool.selfRef.UserName(), difftool.selfRef.Password(),
			difftool.selfRef.Certificates(), difftool.selfRef.ClientCertificate(), difftool.selfRef.ClientKey(),
			difftool.selfRef.IsHalfEncryption(), difftool.logger)

This logic is incorrect as it is possible the source cluster's cert is invalid for loopback address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant