Open ssl unkown protocol - c

I wrote a code that worked for me great, I don't remember modifying it..
I compiled it today and tried to run it, but I got this error:
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
I also tried to connect to the host name with the openssl client, but I've got and error says: Linked closed ping timeout..
I also tried to Install openssl again, and even install an older version but it didn't work..
Any solutions?

I also tried to connect to the host name with the openssl client, but I've got and error says: Linked closed..
It sounds like the remote host is not available. If you can't connect to the remote host using command line tools, then there's nothing you can do with your code to make it work. Verify that the remote host is responding correctly first.

Related

HTTP Server: Connection closed by foreign host

Attempting to get this HTTP webserver I found online running after downloading their source files (source: Webserver). [Files located at bottom of webpage.]
I attempted to compile it using their Makefile but there were some errors, where I just needed to #include some extra libraries. However, once I got that compiled and running (tested using telnet)
telnet localhost <port number>
I get the following:
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Then after 5 seconds or so it displays the following:
Connection closed by foreign host.
I'm not sure if the person who wrote it is still managing it so I figured I'd ask here. Any ideas as to why connection closes?
I'm running this on a Windows machine connected to a Unix server, so as the program site states, it should be running correctly on Unix machines.
in the file: reqhead.c
in the function: Get_Request()
There is a timed call to select()
You can change the timeout value (currently 5 seconds)
or replace the timeout parameter with a NULL parameter (although replacing with NULL would mean the code, once a connection is established would wait forever.)
First we will see ubuntu system log with this command
sudo gedit /var/log/syslog
and if you will see this error "execv( /usr/sbin/tcpd ) failed: No such file or directory"
then run this command
sudo apt-get install tcpd
It will solve your problem (if not then you need to search your system error on google)

How to use webspy?

I tried to spoof my local network with arpspoof from dsniff package. Everything is good, I can see sniffed packets from my "victim" in Wireshark.
Now, how do I use webspy? I've tried something like this with running firefox:
#webspy -i wlan0 192.168.1.XXX
webspy: listening on wlan0
openURL(http://178.33.XXX.XXX/)
The "victim's" computer (192.168.1.XXX) tried to connect with 178.33.XXX.XXX but I couldn't see anything in firefox. Is this requiring something more?
According to this post, two things can be the cause for not getting the victim browser's mirror in webspy:
Firefox browser should be opened from the command-line firefox &, after running the webspy listener.
If dniff (the package of "dniff suite of tools" which includes webspy, dniff,arpspoof,dnsspoof, mailsnarf etc.) is installed by manually compiling the source package instead through the package manager (such as apt-get or yum), the arp.c source file in the unpacked dniff directory should be edited.
The following line in the arp.c file should be changed from
strncpy(ar.arp_dev, "eth0", sizeof(ar.arp_dev));
to
strncpy(ar.arp_dev, "wlan0", sizeof(ar.arp_dev));
Save the file and recompile the application.

Beanstalkd Source Error

I am trying to queue a task using beanstalkd plugin in cakephp. However,
I am getting this error:
BeanstalkdSource - Could not connect. Error given was '111: Connection refused'. in [/var/www/*/app/plugins/queue/models/datasources/beanstalkd_source.php, line 72]
Can you tell me how can I solve this.
Have you installed Beanstalkd and set it running? If you can connect to it OK (run telnet 127.0.0.1 11300 from the command line, and type stats to confirm), then post the connection details, there may be an issue with the PHP side of the connection.

unable to attach client process to postgresql server using gdb

I am working with PostgreSQL 9.3.4 source using Eclipse IDE in ubuntu 14.04. I am facing a problem in attaching client process to postgresql server using gdb to debug. When I start the postmaster then I connect to it from client on a terminal. It works fine. Queries get responses. When I run debug config from eclipse then select postgres process id from list I get error saying
Can't find a source file at "/build/buildd/eglibc-2.19/socket/../sysdeps/unix/sysv/linux/x86_64/recv.c"
Locate the file or edit the source lookup path to include its location.
After this when I send any query from client, it just stucks. No response comes. After attaching gdb to client process, client does not get any response from postgres server. One thing to note is that I was able to debug properly till yesterday. But now it is not working. I tried reinstalling but did not help. How could I fix this issue? Kindly help.
solution which worked for me:
./configure --prefix=$HOME/project --enable-depend --enable-cassert --enable-debug
in eclipse: Make Target: install
attach client process to application

port selfupdate: "macPorts sources: command execution failed"

I am trying to selfupdate my Macports, but I am getting the following message:
Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing
MacPorts sources: command execution failed
I checked my /opt/local/bin/macports and the directory does not exist. Instead, it is in /opt/local/var. Could that be the issue?
Running with -dt, I get the following:
[Users/user] > selfupdate
DEBUG: MacPorts sources location: /opt/local/var/macports/sources/rsync.macports.org/release/base
---> Updating MacPorts base sources using rsync
rsync: failed to connect to rsync.macports.org: Connection refused (61)
rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-42/rsync/clientserver.c(105) [receiver=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/base/ /opt/local/var/macports/sources/rsync.macports.org/release/base
Exit code: 10
DEBUG: Error synchronizing MacPorts sources: command execution failed
while executing
"macports::selfupdate [array get global_options] base_updated"
Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed
What is error 61? Any ideas how I can fix that?
I had this same problem recently, and I forgot to run the command under root. If anyone else is having the problem, be sure to run command as so:
sudo port selfupdate
I was behind a firewall. Tried on a different network and it worked.
There is no /opt/local/bin/macports. The executable you need is /opt/local/bin/port. (Port files are in /opt/local/var/..., which is correct.)
Based on the command execution failed:
you might have forgotten to run as root.
port forks the following programs: rsync, tclsh, openssl, tar, chmod, chown.
Are these executable and in the PATH? (Is /opt/local/bin in your PATH as well?)
If that doesn't help, run port with -dt to get all sorts of debug info. That might help with finding the problem. Append the interesting parts to your question, maybe.
I faced the same issue.But I used to this method in the after.
Go to:
$prefix/etc/macports/sources.conf
(my path is like this):
/opt/local/etc/macports/sources.conf
comment out the rsync entry, and add a new entry as follows:
#rsync://rsync.macports.org/release/tarballs/ports.tar [default]
https://distfiles.macports.org/ports.tar.gz [default]
After that you can run:
sudo port -d sync
It's also explained on MacPorts.com.
Update for Mavericks: to ensure the XCode command line tools are installed, open a terminal and run xcode-select –-install, then follow the instructions in the resulting pop-up window:
accept license
Of course, this is in addition to the other tips such as making sure to run sudo port selfupdate.
If anybody else is having this issue and they've recently updated XCode, the root of my problem was that Command Line Tools had been omitted from the latest build.
Opening XCode and installing Command Line Tools via the XCode preference panel fixed this error being thrown by MacPorts.
If your company block the access via rsync you can use the http tarball. Explained here
Hope this helps.
EDIT: Now prefer to use homebrew
I too had the same error. It is because the network connection is rejected. If you are using University/Company WiFi or public connection, firewall would be refusing the connection.
As you can see from the output of -dt "rsync: failed to connect to rsync.macports.org: Connection refused (61)"
There are workarounds available which are provided on the macports site:
1) Using svn.
2) If svn fails too, you can try using Daily tarball.
You can test the changes by running "sudo port -d sync"
Note: If the https fails, you can replace it with http. But doing so is not recommended, as you will be fetching from insecure connection.
I faced the same issue.
The main problem was my network. Because the NETWORK Port was blocked for;
rsync://rsync.macports.org/release/tarballs/ports.tar
Try to use use another network.
for someone who's problem still exists, maybe you've forgot agree the Xcode license:
# sudo xcodebuild license
remember to look through and type 'agree' in the end.
In my case, the problem was internal to Macports! I updated rsync (the one delivered by Apple is old) with Macports and then Macports failed to use it (/opt/local/bin/rsync) but asked instead to use /usr/bin/rsync which does not exist (or has been erased to force using Macports rsync ?). I created a soft link between the two and now it works again.

Resources