ai-traders / liget

NuGet server and cache running on kestrel in docker
MIT License
219 stars 29 forks source link

Any plans to implement HTTPS? #55

Open AntonZhuchkovXOR opened 9 months ago

AntonZhuchkovXOR commented 9 months ago

I am currently utilizing Liget for local development within Docker, and I consistently encounter a warning from MSBuild:

warning NU1803: You are running the 'restore' operation with an 'HTTP' source, 'http://localhost:9011/api/v3/index.json'. Non-HTTPS access will be removed in a future version. Consider migrating to an 'HTTPS' source.

I'm curious if there are any plans to implement HTTPS support for Liget. The tool has proven to be extremely valuable for my workflow, and I would like to continue using it.

nivinj commented 2 weeks ago

Late response to a question still relevant. Couple of options at present:

  1. For local environments you can quite safely set allowInsecureConnections to true as described here to suppress the warning
  2. You could put LiGet behind a reverse proxy such as Apache or nginx. e.g. Apache config:

    
    <VirtualHost *:443>
        ServerName nuget.company.com
        ServerAlias nuget.company.com *.nuget.company.com
    
        ErrorLog ${APACHE_LOG_DIR}/httpsnuget_error.log
        CustomLog ${APACHE_LOG_DIR}/httpsnuget_access.log combined
    
        ProxyRequests Off
        <Proxy *>
                Order deny,allow
                Allow from all
        </Proxy>
        ProxyPreserveHost On
        RequestHeader set X-Forwarded-Proto "https"
        ProxyPass / http://internal-url.com:9011/
        ProxyPassReverse / http://internal-url:9011/
    
        SSLEngine on
        SSLProtocol             all -SSLv2 -SSLv3
        SSLCertificateFile /etc/tlscerts/nuget.pem
        SSLCertificateChainFile /etc/tlscerts/nuget.pem