Skip to content

Encountered an error,can't proxy to target https server #134

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

Closed
hxfdarling opened this issue Dec 7, 2016 · 2 comments
Closed

Encountered an error,can't proxy to target https server #134

hxfdarling opened this issue Dec 7, 2016 · 2 comments
Labels

Comments

@hxfdarling
Copy link

hxfdarling commented Dec 7, 2016

this is my profile in webpack:

 devServer: {
	port:8080,
	host: "200.200.106.133",
	https: true,
	compress: true,
	contentBase: './src/public',
	historyApiFallback: true,
	stats: 'minimal',
	proxy: {
		"**": "https://200.200.107.226",
		secure: false
	}
}

use this command

curl https://200.200.106.133:8080/test -k

error

response status 500

[HPM] Error occurred while trying to proxy request /test from 200.200.106.133:8080 to https://200.200.107.
226 (undefined) (https://nodejs.org/api/errors.html#errors_common_system_errors)

when I debug http-proxy-middleware,I got an error detail

message:"Hostname/IP doesn't match certificate's altnames: "IP: 200.200.106.133 is not in the cert's list: ""
reason:"IP: 200.200.106.133 is not in the cert's list: "
stack:"Error: Hostname/IP doesn't match certificate's altnames: "IP: 200.200.106.133 is not in the cert's list: "\n at Object.checkServerIdentity (tls.js:199:17)\n at TLSSocket. (_tls_wrap.js:1068:29)\n at emitNone (events.js:86:13)\n at TLSSocket.emit (events.js:185:7)\n at TLSSocket._finishInit (_tls_wrap.js:586:8)\n at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:416:38)"

what can I do?

@hxfdarling hxfdarling changed the title Encountered an error,can't proxy to target server Encountered an error,can't proxy to target https server Dec 7, 2016
@chimurai
Copy link
Owner

Think you've got an invalid webpack proxy config.
Documentation: http://webpack.github.io/docs/webpack-dev-server.html#proxy

 devServer: {
	port:8080,
	host: "200.200.106.133",
	https: true,
	compress: true,
	contentBase: './src/public',
	historyApiFallback: true,
	stats: 'minimal',
        proxy: {
            '**': {
                target: 'https://200.200.107.226',
                secure: false
            }
        }
}

@hxfdarling
Copy link
Author

@chimurai
tks,I got it

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

No branches or pull requests

2 participants