首页 文章

FIWARE - PEP代理配置为HTTPS

提问于
浏览
1

我想知道如何配置PEP代理,以便我可以通过HTTPS交换消息 . 我有一个Orion上下文代理的实例,只有在通过PEP代理后才能访问 . 我的 PEP Proxy (Wilma) 配置文件(config.js)具有以下内容:

config.https = {
   enabled: true,
   cert_file: 'cert/idm.crt',
   key_file: 'cert/idm.key',
   port: 443
};

config.account_host = 'https://localhost:8000';   //account.lab.fiware.org';
config.keystone_host = 'localhost'; //'cloud.lab.fiware.org';
config.keystone_port = 5000; //4731;

config.app_host = 'https://orion'; //'localhost';
config.app_port = ''; //Nginx is configured to redirect to port 1026
// Use true if the app server listens in https
config.app_ssl = true;

config.username = 'pep_proxy_credential_obtained_at_portal';
config.password = 'password_obtained_at_portal';

我还有HTTPS到HTTP(Nginx配置为反向代理),以便我直接发送给Orion的请求是安全的 . HTTPS仅在没有PEP代理流的情况下工作 . 当我插入授权/认证流程时,我遇到问题,因为PEP代理不处理SSL证书 . 这是 Nginx 配置:

location / {
    proxy_set_header        Host $host;
    proxy_set_header        X-Real-IP $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header        X-Forwarded-Proto $scheme;

    # Fix the “It appears that your reverse proxy set up is broken" error.
    proxy_pass          http://orion:1026;
    proxy_read_timeout  90;
    proxy_redirect      http://orion:1026 https://orion;
}

我希望以我只能通过HTTPS与Orion通信的方式集成我所拥有的内容,包括PEP代理流程 . 我已经搜索了但是我没有发现与PEP代理中的HTTPS配置有关的任何有用的东西 .

编辑:PEP代理重定向到应用程序时出错:

2017-01-17 20:52:55.544  - INFO: Server - Success authenticating PEP proxy. 
Proxy Auth-token:  d7ec08edd87d43418edfd558df26f427
2017-01-17 20:53:49.450  - INFO: IDM-Client - Checking token with IDM...
2017-01-17 20:53:49.508  - INFO: Root - Access-token OK. Redirecting to app...
Refused to set unsafe header "accept-encoding"
Refused to set unsafe header "content-length"

该应用程序提供的错误是:

('Connection aborted.', BadStatusLine('HTTP/1.1 0 unknown\r\n',))

2 回答

  • 1

    问题是配置时的https:

    config.app_host = 'https://orion';
    

    我不得不调试才发现这个 . PEP代理Wilma将协议(http或https)添加到配置的应用程序主机 . 正确的是在没有协议的情况下进行配置:

    config.app_host = 'orion';
    

    也许这个观察可以添加到Wilma文档中,以避免像我这样的错误 .

  • 0

    您可以使用配置文件中的参数“https”将PEP代理配置为使用HTTPS进行侦听

    https://github.com/ging/fiware-pep-proxy/blob/master/config.js.template#L7

相关问题