Comments (20)
Are you behind a proxy server by chance? If so, can you determine if the proxy server is blocking your requests?
from librarymanager.
Are you behind a proxy server by chance? If so, can you determine if the proxy server is blocking your requests?
I'm on the standalone PC without proxies.
from librarymanager.
Problem still existing on VS2022
Sequence of the commands and result
libman.json (left only one lib for test)
from librarymanager.
RESOLVED it with changing project file to newer version:
I have same issue. I have a project of 2020 which I need to debug. I have errors on build:
1>Restore operation started...
1>libman.json : error LIB002: The "[email protected]" library could not be resolved by the "cdnjs" provider
1>libman.json : error LIB002: The "[email protected]" library could not be resolved by the "cdnjs" provider
1>libman.json : error LIB002: The "[email protected]" library could not be resolved by the "cdnjs" provider
1>libman.json : error LIB002: The "[email protected]" library could not be resolved by the "cdnjs" provider
I did remove the libraries from www\lib and did install libman 2.1.175+29a28921bd.RR
My solution has multiple projects and to use libman clean/ restore I needed to move one directory folder up where my libman.json is located. Maybe that is the problem?
from librarymanager.
RESOLVED it with changing project file to newer version
What do you mean under this?
I did remove the libraries from www\lib and did install libman 2.1.175+29a28921bd.RR
- Removed libs from www\lib
- version of the libman just reinstalled: 2.1.175+29a28921bd.RR
Problem still exists.
SUrprise that even in GUI - I've no intellisense for the libraries as on screenshot. All files are empty.
from librarymanager.
Problem still existing on my base PC and not even raised on my laptop (same network configuration), even after VS updated to 17.4.0 version.
Any help?
from librarymanager.
In the project file there are also dependencies. Those are pointing to the old version. Right click your project so that it is editable, and then change the versions. That helped for me.
from librarymanager.
Same version. Tried to change and restore back - still no results.
Problem is that it even does not show any libs in the list, when you typing project start letters....
from librarymanager.
Is it possible to get a guide "how to run this extension in debug?" somehow? To try to debug and understand what is going wrong?
from librarymanager.
For debugging the VS extension, the steps should be:
- git clone the repo
- Open the LibraryManager.sln in VS (VS may prompt you to install any workloads or components if they're missing)
- Set the startup project to the Microsoft.Web.LibraryManager.Vsix project
- F5, or if you have multiple instances of VS installed, use the debugger dropdown to target a different instance of VS
This will launch the experimental instance of VS (intended for testing extensions, won't affect your main VS install).
If you get a build error that the VSIX version must be greater than what is currently installed (I forget the exact wording), you need to add an additional commit to increment the version.
git commit -m "version bump" --allow-empty
should work, but please remove that empty commit if submitting a PR.
For the dotnet tool, you can also build from VS and set it as the startup project to F5, or launch it on the command line using dotnet libman.dll ...
from the build output directory.
For the MSBuild tasks, you need to build them, then create a project that references your private build of the nuget package. To ease debugging, insert System.Diagnostics.Debugger.Launch();
in the task you want to debug.
There's a build.cmd script in the repo root that will build everything (.cmd implies it's for Windows only, but it's just a wrapper to call msbuild LibraryManager.sln
with some other flags set by default).
This is lacking from the README but it's a good idea to put there. Feel free to submit a PR, or I'll add this to my todo list as soon as I have time.
from librarymanager.
Hi,
on this weekends I decide to investigate and have some results:
- During process of debug I received an Exception on the: WebRequestHandler->GetStreamAsync(...): and InternalException shown me the reason of the problem -> The request was aborted: Could not create SSL/TLS secure channel.
- I've checked Internet options (on PC, which HAS problem) and define that all TLS are switched on:
on my laptop (on which LibMan working fine) TLS settings looks like:
- Started to dig and found changes with which LibraryManager started to work. Please see the differences (4.) and code which required to "fix" problem (5.):
- These changes allow LibMan to work even with "Use TLS 1.3 (experimental)" checked on (see details below)
private HttpClient CreateHttpClient(string url)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(AllwaysGoodCertificate);
#pragma warning disable CA2000 // Dispose objects before losing scope
var httpMessageHandler = new HttpClientHandler();
#pragma warning restore CA2000 // Dispose objects before losing scope
httpMessageHandler.Proxy = _proxySettings.GetProxy(new Uri(url));
var httpClient = new HttpClient(httpMessageHandler);
httpClient.DefaultRequestHeaders.UserAgent.ParseAdd($"LibraryManager/{ThisAssembly.AssemblyFileVersion}");
return httpClient;
}
private static bool AllwaysGoodCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors policyErrors)
{
return true;
}
Results:
- I understand that these security changes are "fast-fix" and they could harm general process - so it is up to you to add them or not, but I guess it helps you to investigate more and apply more adequate changes (and BTW - logs, cause logs are not containing info about SSL/TLS problems)
- For fast solution w/o code changes: is required to open "Internet Options -> Advanced tab" and uncheck "Use TLS 1.3 (experimental)" - exactly this checkbox prevent the HttpClient working process (all others TLS checkboxes - could be switched on).
- You could close this ticket with your comment. Hope my investigations was useful.
from librarymanager.
@LLIAMAH Thanks for the write-up! Can you clarify a couple details?
- If you change your settings on your PC to disable TLS 1.3 (experimental), does libman work without your modifications?
- What version of Windows are you running? On mine (Win11 22H2), TLS 1.3 is not labeled as experimental, so I'm wondering if this issue only reproduces on an older version (which may have a bad implementation)
from librarymanager.
- If you change your settings on your PC to disable TLS 1.3 (experimental), does libman work without your modifications?
Results - Nr.2 answer on this ;).
Yes, if you switch OFF only this checkbox "TLS 1.3 experimental" - all work fine without any code changes. Other TLS versions are not affect.
- What version of Windows are you running? On mine (Win11 22H2), TLS 1.3 is not labeled as experimental, so I'm wondering if this issue only reproduces on an older version (which may have a bad implementation)
I don't have Win11 to check this :\
from librarymanager.
Found additional problem:
If "TLS 1.3 (Experimental)" unchecked - a lot of site certificates became "unsecured", which prevent general functionality.
So it is required to be fixed somehow.
from librarymanager.
Sorry for accidental closing - but it is required to resolve problem.
from librarymanager.
BTW it could be catched exception 'The request was aborted: Could not create SSL/TLS secure channel." (don't forget that it is Internal Exception) and applied retry with something like:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; // redefinition of the protocol to get data
var client = new HttpClient(new HttpClientHandler() { });
var res = AsyncHelper.RunSync(() => client.GetAsync("https://api.cdnjs.com/libraries"));
ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault; // restoring SystemDefault value
from librarymanager.
It it possible to know approximate date when will be some fix?
from librarymanager.
I set up a VM with Windows 10, same build as yours, but I can't reproduce this issue yet after trying for several hours. I've tried every combination of TLS settings available in the Internet Options, but they all work fine for me with any libman provider. It's quite vexing that I can't reproduce the problems you're experiencing, whether with TLS 1.3, 1.2, or with older deprecated versions, so I'm having a hard time validating any potential solutions.
I'm wary of making a change to hard-code a TLS version, as everything older than TLS 1.2 is already deprecated for security issues - I'm sure it's only a matter of time before 1.2 is broken as well, which is why it's best to use the OS defaults, as those will be updated by OS security patches as needed. I'd recommend disabling the older versions off on your desktop as well, unless you frequent sites that don't support TLS 1.2.
from librarymanager.
I'm agree with you that it is bad decision to hardcode this thing, but isn't better to set try...catch block for AuthenticationFailed error?
I mean: try with high-level security cert, if failed - decrease on one step, then again. and only if TLS 1.1 or SSL 3.0 failed - return at last some log info - please contact admin cause your security system configured awful.
Cause info about problem - I didn't find in any log at all: BTW did some experiments with HttpClient and found that default (without properly configured handler) behavior return 4-levels Exception:
Exception: System.Net.Http.HttpRequestException: An error occurred while sending the request.
InnerException: System.IO.IOException: The read operation failed, see inner exception.
InnerException: System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.
InnerException: System.ComponentModel.Win32Exception (0x80090326): The message received was unexpected or badly formatted.
But all this respond surrounded by the first one: An error occurred while sending the request - that's all.
from librarymanager.
I don't think doing a manual backoff (reducing TLS versions) is useful outside of debugging. It can lead to other error states (for example, JSDelivr doesn't support anything below TLS 1.2, so a request with only 1.1 will fail to negotiate), and it's a security step I'm not willing to make at this time, not until we have a larger number of reports with this as a consistent issue.
Improving the logging is important and has come up a number of other times (such as in #601 and #697).
For now, I'd recommend that you uncheck the TLS 1.3 on your desktop since that was verified to work around the problem. I don't know why it causes problems for you but not for me on a similar machine.
from librarymanager.
Related Issues (20)
- Package Microsoft.Web.LibraryManager.Cli 2.1.175 is not compatible with net6.0 HOT 1
- Allow specifying destination per file HOT 7
- Lowering importance of informational messages from `RestoreTask`
- Add macOS Arm64 support to the CLI tool HOT 4
- libman does not allow defining the bootstrap package twice (without ignoring one of them).
- Restore operations happen in foreground in Class Library projects in Visual Studio
- libman: library could not be resolved by 'cdnjs' provider AGAIN HOT 8
- Switch to MIT license
- Consolidate Nuget feed
- version 2.1.175 doesn't support .Net 7.0.11 HOT 9
- Error during restore mentioning libman.config.json in use.
- "[email protected]" library could not be resolved HOT 6
- Expose latest version via CLI, without updating
- dotnet libman update installs deprecated package versions HOT 1
- Libman restore failed in Abp Boilerplate demo HOT 1
- libman command error after installed the Microsoft.Web.LibraryManager.Cli HOT 1
- Unable to build the project locally HOT 3
- Proposal for more granular file mappings per library
- @latest tag needs to handle fluctuating version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from librarymanager.