Showing posts with label Network. Show all posts
Showing posts with label Network. Show all posts

Friday, March 17, 2023

Debug SSL connection with ssltap


1. Run ssltap on port 19240:

 $ ssltap -s -p 19240 <remote host>:<remote port>

 2. In a browser, access the remote-host:remote-port by connecting to ssltap:

https://localhost:19240

 3. Check the ssltap's output


Tuesday, March 14, 2023

nginx configuration example for a simple proxy


Build nginx from source code:

$ ./configure --prefix=/path/to/install --with-http_ssl_module --without-http_rewrite_module --with-debug

$ make; make install


Configuration locates at /path/to/install/conf/nginx.conf.

Example of the configuration (for demo purpose only):

server {
  listen  443 ssl;
  server_name localhost;
 
  ssl_certificate  ngcert.pem;
  ssl_certificate  ngprivkey.pem;
 
  # disable HSTS when we are using self-signed certificate
  add_header Strict-Transport-Security  "max-age=0";
 
  ssl_session_cache  shared:SSL:1m;
  ssl_session_timeout  5m;
 
  ssl_ciphers  HIGH:!aNULL:!MD5;  # adjust to remove week ciphers
  ssl_prefer_server_ciphers  on; 

  location / {
    root  html;
    index  index.html;
  }

  location / {
    proxy_pass  https://destination-url/;
  }
}

Run nginx:
$ nginx

   

Monday, November 4, 2019

Some curl command options


To access a web page:
$ curl http://www.google.com

If the web server does not provide a trusted certificate, or it is using a self-signed certificate, we can accept the it by using the -k option:
$ curl -k http://www.google.com

To turn on verbose mode:
$ curl -v -k http://www.google.com

To use HTTP 1.0:
$ curl -v -k http://www.google.com --http1.0

To remove the "Host:..." header:
$ curl -v -k http://www.google.com --http1.0 -H 'Host:'

To remove more headers:
$ curl -v -k http://www.google.com --http1.0 -H 'Host:' -H 'User-Agent:' -H 'Accept:'



Monday, April 29, 2019

Network printer stops working after restart


Today, I found my Canon printer not working after being powered on. It was working well before the last power-off. During the restart, there was a message saying that the IP address of the printer was changed.

I guessed the IP address change could be the problem so I decided to change it back. To find the old IP address of the printer, I opened the Control Panel and entered Devices and Printers. Then I right clicked on the Canon printer, and chose Printer properties. There I clicked on the Change Properties button, and then clicked on the Ports tab. I found the Canon printer in the list and clicked on the Configure Port button. The IP address of the printer was shown there.

Then I went to the Network Settings menu of the printer and disabled the DHCP protocol and set it to manually configure the IP address of the printer.

I also needed to login to the router to reserve the IP address for the printer so that the router wouldn't assign it to other devices when the printer was off.

After all the changes, the printer worked again.

In summary, to make a network printer working properly with Windows, we need to give it a fixed IP address. If the printer has already been set up in the Windows, we can make it always visible to the Windows by:
  1. Find the IP address of the printer in Windows.
  2. Disable DHCP protocol of the printer and give the printer a fixed IP address as the above one.
  3. Login to the router and reserve the IP address for the printer's MAC address.
 
Get This <