Tag Archives: proxy

[Solved] gnutls_handshake() failed: The TLS connection was non-properly terminated

Error

chiyukunpeng@chiyukunpeng: ~$ git clone --recursive https://github.com/mrnabati/CenterFusion.git
is being cloned to 'CenterFusion'...
fatal: unable to access 'https://github.com/mrnabati/CenterFusion.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

Solution

# check proxy
chiyukunpeng@chiyukunpeng: ~$ git config --global -l
http.postbuffer=524288000
http.proxy=http://proxy.server.com:8080
http.proxy=http://127.0.0.1

# Delete proxy variables one by one
chiyukunpeng@chiyukunpeng: ~$ git config --global  --unset http.proxy http://127.0.0.1
chiyukunpeng@chiyukunpeng: ~$ git config --global  --unset http.proxy http://proxy.server.com:8080
chiyukunpeng@chiyukunpeng: ~$ git config --global  --unset http.postbuffer

When configuring the proxy with Vue, the front-end requests the server-side error 504; the Vue console reports the error occurred while trying to proxy request

Error occurred while trying to proxy request/login/from 127.0.0.1:8080 to http://127.0.0.1 :8081 (ECONNREFUSED) ( https://nodejs.org/api/errors.html#errors_ common_ system_ errors)

I searched for information on the Internet and found various answers. Then I tried several answers and found that there should be a problem with the port,

Finally, change the proxy address to http://127.0.0.1 9090 is the solution!

Image proxy settings Flash + JavaScript

The article directories
Problem description idea specific implementation front end back end

Problem description
If is request http://www.example.com/image1.png picture originally, now ask for pictures, https://www.petal.social/image/www.example.com/image1.png you will need to do an image proxy
(request pictures to our own when the server request, then our HTTP server request images, the result of the HTTP in the way back to the web site of the HTTPS)
Train of thought
First, add an API locally for the front-end request that returns the modified image URL
The specific implementation
The front end
Original version:

showImage(url) {
    if (url.startsWith('http://')) {
        if (url.includes('qpic.cn') || url.includes('gtimg.cn')) {
            return url.replace('http://', 'https://')
        } else {
            return return 'https://demo.cloudimg.io/v7/' + url
        }
    } else {
        return url
    }
}

Image URL contains /, so in Flask is mistaken for routing calls, so you need to for the original URL with Base64 encryption
modify after:

import {Base64} from 'js-base64'
const BASE_URL = 'http://localhost:5000'
// const BASE_URL = 'https://www.petal.social'
showImage(url) {
    if (url.startsWith('http://')) {
        if (url.includes('qpic.cn') || url.includes('gtimg.cn')) {
            return url.replace('http://', 'https://')
        } else {
            return BASE_URL + '/api/v1/image/' + Base64.encode(url)
        }
    } else {
        return url
    }
}

The back-end

from flask_restplus import Namespace, Resource
from flask import request, make_response
from maintenance import check_maintenance, not_under_maintenance
import requests
from flask import Response, stream_with_context
import base64
image_api = Namespace('image', description='image related public interface')

@image_api.route('/<image_url>')
@image_api.param('image_url', 'The original image url')
class Image(Resource):
    @image_api.doc('get_image_url')
    @not_under_maintenance
    def get(self, image_url):
        check_maintenance()
        image_url = base64.b64decode(image_url)
        res = requests.get(image_url, stream = True)
        return Response(stream_with_context(res.iter_content(2048)), content_type = res.headers['content-type']) 

ajp_read_header: ajp_ilink_receive failed

Using the HTTPD proxy_AJp module, proxy_AJp.conf is configured as follows

ProxyPass /examples/ ajp://localhost:8009/examples/

error occurs when accessing http://hostname/examples:

[Wed Feb 01 15:56:37 2012] [error] (70014)End of file found: ajp_ilink_receive() can't receive header

[Wed Feb 01 15:56:37 2012] [error] ajp_read_header: ajp_ilink_receive failed

[Wed Feb 01 15:56:37 2012] [error] (120006)APR does not understand this error code: proxy: read response failed from (null) (localhost)

Tomcat startup information:

Feb 1, 2012 4:54:34 PM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory ROOT

Feb 1, 2012 4:54:35 PM org.apache.coyote.http11.Http11Protocol start

INFO: Starting Coyote HTTP/1.1 on http-8090

Feb 1, 2012 4:54:36 PM org.apache.jk.common.ChannelSocket init

INFO: Port busy 8009 java.net.BindException: Address already in use

Feb 1, 2012 4:54:36 PM org.apache.jk.common.ChannelSocket init

INFO: JK: ajp13 listening on /0.0.0.0:8010

Feb 1, 2012 4:54:36 PM org.apache.jk.server.JkMain start

INFO: Jk running ID=1 time=0/645 config=null

Feb 1, 2012 4:54:37 PM org.apache.catalina.startup.Catalina start

INFO: Server startup in 207063 ms

solution:

it can be seen from the tomcat startup information that port 8009 is used, so change the ajp port under conf/server.xml from 8009 to 8010


<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

instead


<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />

ProxyPass is also modified to port 8010


ProxyPass /examples/ ajp://localhost:8010/examples/

specific why 8009 port is used, it is not clear, welcome to communicate.

Error: Failed to synchronize cache for repo ‘fedora’

When executing DNF Update, you encountered the following problem:

[zhangz@zwfedora23 ~]$ sudo dnf update
[sudo] password for zhangz:
    Error: Failed to synchronize cache for repo 'fedora'
[zhangz@zwfedora23 ~]$

Later, it was found that the agent problem was set before:

  1 [main]
  2 gpgcheck=1
  3 installonly_limit=3
  4 clean_requirements_on_remove=True
  5
  6 #proxy=http://10.0.13.109:808
~
~
~
~
~
~
~
~
~
~
~
/etc/dnf/dnf.conf [TYPE=] [POS=0006,0001][100%] [LEN=6]
"/etc/dnf/dnf.conf" [readonly] 6L, 103C

Just comment out the proxy line above.
all the existing proxy line, because I need a proxy in the company, otherwise when I connect to the external network, direct dial-up Internet at home there is no proxy problem, the 10 network segment of the LAN address does not exist, so the use of DNF will prompt an error.

Ubuntu cannot access USB device, failed to create a proxy device for the USB device

Ubuntu cannot access the USB device, Failed to create a proxy device for the USB device

method one: trying to install VirtualBox Extension Pack, address: https://www.virtualbox.org/wiki/Downloads. The WARNING in USB setting will disappear. Also: All warnings of Virtual Box should be alert and try to handle, or the OS inside the sandbox will be buggy.


method failed, try: https://superuser.com/questions/1136607/virtualbox-usb-capture-issue-windows-7-host-guest