I have 2 servers. An isolated application server (PHP) that can not access the GMAIL IMAP server (imap.gmail.com:993). A second server on the internal network that can acesss. The application server and the second server communicate well. I would like to call the Gmail IMAP from the application server via the second server.
I tested Squid, not working. because Squid is an HTTP proxy. HTTP is NOT pop3, smtp, imap. So I tried imap over ssh with the following command:
ssh -N -L 1234:imap.gmail.com:993-L user#mysecondhost
But When I test with my PHP code :
$connect_to = '{localhost:1234/imap/ssl/novalidate-cert}INBOX';
$user = 'mygmailaccord#gmail.com';
$password = 'mypassword';
$connection = imap_open($connect_to, $user, $password)
or die("Can't connect to '$connect_to': " . imap_last_error());
echo "ok";
imap_close($connection);
The tunnel not working. Any idea how I can call the Gmail imap service ?
Thanks in advance
Related
I have configured azure load balancer which points my public Ip http, and I reach my website and working fine.
Now, I want to achieve a routing rule is used to redirect the application traffic from HTTP protocol to HTTPS secure protocol with the help of azure application gateway.
Can we simply add our HTTPS services to the health probe after installing an SSL certificate on the load balancer? I don't have much knowledge in networking any help highly appreciate.
I tried to reproduce the same in my environment it works fine successfully.
you are able to configure your public Ip address to https using Azure application gateway. Try to create a self-signed certificate like below:
New-SelfSignedCertificate `
-certstorelocation cert:\localmachine\my `
-dnsname www.contoso.com
#To create pfx file
$pwd = ConvertTo-SecureString -String "Azure"-Force -AsPlainText
Export-PfxCertificate `
-cert cert:\localMachine\my\<YOURTHUMBPRINT> `
-FilePath c:\appgwcert.pfx `
-Password $pwd
Try to create an application gateway. you can use your exciting public Ip address like below.
In routing rule add your frontend Ip as public and protocol _ HTTPS _ as_ 443 ports _ and upload a pfx certificate like below:
Then, try to create listener with port 8080 with http and add routing rule as same and verify the backend status is healthy like below:
When I test the http protocol with Ip address redirect successfully like below:
I have created an application in Things Network for LoRaWAN. Also registered a device within that application.
Already register a service in LoRaWAN IoT Agent and provisioned a device with provider as TTN in LoRaWAN IoT Agent.
Created a HTTP integration in Things Network Stack for my IoT Agent.
I also received data sent from Things Network Uplink client in my registered IoT agent.
Uplink payload from Things Network
01 67 00 FF
Now i want to send uplink message from postman or MQTT publisher client.
I tried to create a payload for postman i.e. Url : http://MyMachineIP:4061/iot/json?=MyDeviceId&k=APIKEY
JSON PAYLOAD
{
"app_id": "MyApplicationID",
"dev_id": "MyDeviceId",
"hardware_serial": "AAAAAAAAAAAAAAAA",
"payload_raw": "AWcA/w==",
"metadata": {
"gateways": [
{
"gtw_id": "TEST_1",
"rssi": 0,
"snr": 0
}
]
}
}
but got error Cannot POST /iot/json.
I also tried using MQTT Publisher Client:
Installed Eclipse Mosquitto providers a CLI to subscribe and to publish
messages.
Start Mosquitto Service.
MQTT command to publish uplink measure:
mosquitto_pub -h eu.thethings.network -p 1883 -u applicationid-P ttn-account-v2.xXXXXXXXXXXXXXXXXXXXXXXXXX -t applicationid/devices/deviceid/up -m '{"port":1,"payload_raw":"AWcAuw=="}' -d
MQTT command to subscribe uplink measure:
mosquitto_sub -h eu.thethings.network -p 1883 -u applicationid -P ttn-account-v2.x2Q20IXXXXX
I recommend you reading this IoT Agent LoRaWAN guide https://fiware-lorawan.readthedocs.io/en/latest/users_manual/index.html
Device provisioning, config and read this part:
In this case, the IoTA will subscribe to any observation coming from the LoRaWAN application server. Whenever a new update arrives, it will create the corresponding device internally and also in the Context Broker using the pre-provisioned configuration. Finally, it will forward appropriate context update requests to the Context Broker to update the attributes' values.
Regards!
I am writing a simple mqtt client which will connect with a mosquitto broker.
I have used the C++ wrapper (mosquittopp) of the mosquitto library to write the mqtt client. However, I don't know how to authenticate a client with username and password through functions provided by the mosquittopp wrapper while connecting.
I am looking for the implementation of following client-tool command with the help of mosquittopp.
mosquitto_pub -m "testing" -t test -u sheheryar -P coke
You can set user and password before connecting with
mosquittopp::username_pw_set(sUser, sPassword);
I wanted to give a try to vault, so I configured VAULT_ADDR as:
$ echo $VAULT_ADDR
http://127.0.0.1:8200
then I started vault in dev mode (vault server -dev) and everything was ok, I was able to connect to the server.
Then I wrote a really simple config file:
$ cat vault.config
backend "inmem"
listener "tcp" {
address = "127.0.0.1:8200"
tls_disable = 1
}
disable_mlock = true
and I restarted the server with vault server -config=vault.config, but then when I connect to the server, I get:
$ vault status
Error checking seal status: Get http://127.0.0.1:8200/v1/sys/seal-status: dial tcp 127.0.0.1:8200: getsockopt: connection refused
Is there something wrong in my config file?
You need to configure the back end like this:
backend "inmem" {}
otherwise there is a problem parsing the listener clause.
I cannot ping http://localhost:3000 from my terminal with Webrick running.
However, when loading it on a web browser I get the default "Welcome abroad" page.
I'm using Rails as a backend service for a mobile app - so I need to access the API this way.
>ping http://localhost:3000/
ping: cannot resolve http://localhost:3000/: Unknown host
>ping http://127.0.0.1
ping: cannot resolve http://127.0.0.1: Unknown host
>ping http://127.0.0.1:3000
ping: cannot resolve http://127.0.0.1:3000: Unknown host
The ping command sends ICMP packets and has no idea what a URL is, it pre-dates the web by about ten years. It wants a hostname, like:
ping localhost
What you want is to use a web tool like curl or wget to access your page:
curl http://localhost:3000/