Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I tried to download the same and it results in a file of size 19286 bytes (the same as yours) which is a HTML document. From Firefox it redirects me to a login page. Maybe you have simply to provide username and password by means of --user and --password options of wget. Just a guess.
That's only a WARNING. Instead if you don't use the --no-check-certificate option you get an ERROR and the file is not downloaded:
Code:
┌─[colucix@ocean-4]-[~]
└─• wget -c https://www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf
--2011-08-29 11:36:21-- https://www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf
Resolving www.smart-developer.com... 80.237.227.161
Connecting to www.smart-developer.com|80.237.227.161|:443... connected.
ERROR: cannot verify www.smart-developer.com’s certificate, issued by “/C=US/O=Thawte, Inc./OU=Domain Validated SSL/CN=Thawte DV SSL CA”:
Unable to locally verify the issuer’s authority.
To connect to www.smart-developer.com insecurely, use ‘--no-check-certificate’.
It looks like it checks the certificate in any case, but using the --no-check-certificate it ignores it afterwards. This is clearly stated in the wget manual:
Quote:
This option forces an “insecure” mode of operation that turns the certificate verification errors into warnings and allows you to proceed.
Two things coming in my mind: does the password contain some special characters expanded by the shell? Have you tried to enclose it in single quotes? An alternative to send credentials is to embed them in the URL:
Seems the shell can't tolerate @ in the username!
See the placements of quotes too.
Scroll right.
Code:
anisha@linux-dopx:~> wget -c https://x.y.z@gmail.com:abc@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf
https://x.y.z@gmail.com:abc@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf: Bad port number.
anisha@linux-dopx:~> wget -c https://'x.y.z@gmail.com':abc@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf
https://x.y.z@gmail.com:abc@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf: Bad port number.
anisha@linux-dopx:~> wget -c https://'x.y.z@gmail.com:abc'@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf
https://x.y.z@gmail.com:abc@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf: Bad port number.
anisha@linux-dopx:~> wget -c https://x.y.z:abc@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf
--2011-08-29 16:01:38-- https://x.y.z:*password*@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf
Resolving www.smart-developer.com... 80.237.227.161
Connecting to www.smart-developer.com|80.237.227.161|:443... connected.
ERROR: cannot verify www.smart-developer.com's certificate, issued by `/C=US/O=Thawte, Inc./OU=Domain Validated SSL/CN=Thawte DV SSL CA':
Unable to locally verify the issuer's authority.
To connect to www.smart-developer.com insecurely, use `--no-check-certificate'.
Unable to establish SSL connection.
What to do?
Last edited by Aquarius_Girl; 08-29-2011 at 05:27 AM.
Tried this, it didn't show the bad port error though,
but didn't result in anything meaningful too. The size
of the pdf (after downloading) is still 186 KB, whereas
the actual file is of 20 MB.
Look at the second output in the above post, please.
I noticed it but I meant to use the --user option instead of embedding the user/pass in the URL. Anyway, since the bad port error disappeared, I think the @ is interpreted correctly. Unfortunately, I am running out of suggestions, now!
I found an interesting example in the wget man page. It assumes the remote server uses cookies to manage the authenticated session:
Code:
This example shows how to log to a server using POST and then proceed to download the desired
pages, presumably only accessible to authorized users:
# Log in to the server. This can be done only once.
wget --save-cookies cookies.txt \
--post-data 'user=foo&password=bar' \
http://server.com/auth.php
# Now grab the page or pages we care about.
wget --load-cookies cookies.txt \
-p http://server.com/interesting/article.php
If the server is using session cookies to track user authentication, the above will not work
because --save-cookies will not save them (and neither will browsers) and the cookies.txt file
will be empty. In that case use --keep-session-cookies along with --save-cookies to force saving
of session cookies.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.