I need to send request to a web server which is TLS 1.2 in node soap
any idea how to achieve that?
You have to set the secureOptions with a constant on the ClientSSLSecurity method.
var constants = require('constants');
client.setSecurity(new soap.ClientSSLSecurity(
'/path/to/key',
'/path/to/cert',
'/path/to/ca-cert',
{
strictSSL: true,
rejectUnauthorized: false,
hostname: 'some-hostname',
secureOptions: constants.SSL_OP_NO_TLSv1_2,
forever: true,
},
));
Related
I changed socket io transport type as websocket on server side to use it with multiple pods on Kubernetes. However client side try to request with transport polling type. On the client side I used vue-socket.io package and the implementation :
Vue.use(new VueSocketIO({
debug: false,
connection: socketConnection,
vuex: {
store,
actionPrefix: 'SOCKET_',
mutationPrefix: 'SOCKET_',
},
options: { transports: ['websocket'], path: '/' },
}))
However, Client did not change the transport type as websocket, the url example is http://localhost:6164/socket.io/?EIO=4&transport=polling&t=N_qVTMh
I got an old web app runing Meteor 1.6.1.1 in which we request data from restcountries.com. Unfortuanately Meteor now thinks that their certificate has expired. Presumable because of the R3 Certificate that expired a while ago. Since migration/update to another framework is not planned, I wanted to disable certificate verification for now. But I can't figure out how. I've tried setting strictSSL to false in the call options, but it doesn't have any effect:
var response = HTTP.get(apiUrl, {
headers: {
"User-Agent": "Meteor/1.0", //Required for EUROSTAT provider
"Accept": "application/json"
},
strictSSL: false
}).data;
You can use the env variable of Node: NODE_TLS_REJECT_UNAUTHORIZED
https://docs.meteor.com/expired-certificate.html
During request GET in Postman (https://localhost:9001/test)
I've received an error:
Error: write EPROTO 8768:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:c:\users\administrator\buildkite-agent\builds\pm-electron\postman\electron-release\vendor\node\deps\openssl\openssl\ssl\record\ssl3_record.c:252:
Warning: This request did not get sent completely and might not have all the required system headers.
Postman Configuration:
SSL certificate verification is disabled;
Proxy configuration - Default Proxy Configuration and Proxy configurations for sending requests are disabled;
Request timeout in ms - 0.
For Localhost we don't really need https, please try with http://localhost:9001/test
check that you are using the HTTP protocol not HTTPS to send requests to the server:
example
export const config = {
baseUrl: "http://localhost:4000"
}
it has to be the http not https for localhost
"http://localhost:3000"
NOT
"https://localhost:3000"
const transporter = nodemailer.createTransport({
host:'smtp.gmail.com',
port:587,
secure:false,
requireTLC:true,
auth: {
user:'youmail#gmail.com',
pass:'youpass'
}
}
Notice that secure: is false.
The error occurs when secure: is true.
the reason was in an incorrect link.
In the controller I have used
#RequestMapping(value="/{baseSiteId}/test")
And this {baseSiteId} was not what I expected.
I'm learning about front-end and back-end interfaces docking. But I met a problem.
My back-end project's port is 8081 and when I send this request http://localhost:8081/hello, I will receive a reponse bodyhello
And my front-end project's port is 8080. When I send request likes http://localhost:8080/hello, the response of it is the same as http://localhost:8081/hello
Here's my vue.config.js
let proxyObj = {};
proxyObj['/']={
ws: false,
target: 'http://localhost:8081',
changeOrigin: true,
pathRewrite: {
'^/': ''
}
}
module.exports= {
devServer: {
host: 'localhost',
port: 8080,
proxy: proxyObj
}
}
If I change proxy: proxyObj to proxy: null then go http://localhost:8080/hello, I receive nothing but a blank. Is anything wrong with my vue.config.js file?
Any help will be appreciated!
DevServer proxy will proxy requests depend on your proxy config:
// '/'means this rule will match all requests
proxyObj['/']={
ws: false,
// target means requests that matched will be sent to http://localhost:8081
target: 'http://localhost:8081',
changeOrigin: true,
pathRewrite: {
'^/': ''
}
}
With this config, all your requests will be sent to the backend server, you will receive a response from the server. If you set your config object to null, your requests will be sent to your frontend project: http://localhost:8080, so you can't receive any response.
See here for more detail about proxy config.
Have you ever met this message in a React Native application using a WebSocket ( SocketIOClient from 'socket.io-client') ?...
Unrecognized WebSocket connection option(s) `agent`, `perMessageDeflate`, `pfx`, `key`, `passphrase`, `cert`, `ca`, `ciphers`, `rejectUnauthorized`. Did you mean to put these under `headers`?
Yes, this is happening in the WebSocket class constructor in Socket.io. I think it happens when you specify your transport layer as 'websocket' in the constructor (which is necessary for React Native socket io use). It doesn't do anything bad, but is annoying.
You can get rid of it with the react-native YellowBox.ignoreWarnings:
When initiating your app:
console.ignoredYellowBox = ['Remote debugger'];
import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings([
'Unrecognized WebSocket connection option(s) `agent`, `perMessageDeflate`, `pfx`, `key`, `passphrase`, `cert`, `ca`, `ciphers`, `rejectUnauthorized`. Did you mean to put these under `headers`?'
]);
The one way to remove the error:
let socket = io.connect(SOCKET_URL, {
timeout: 10000,
jsonp: false,
transports: [‘websocket’],
autoConnect: false,
agent: ‘-’,
path: ‘/’, // Whatever your path is
pfx: ‘-’,
key: token, // Using token-based auth.
passphrase: cookie, // Using cookie auth.
cert: ‘-’,
ca: ‘-’,
ciphers: ‘-’,
rejectUnauthorized: ‘-’,
perMessageDeflate: ‘-’
});