You are here

I think I messed my mono installation

8 posts / 0 new
Last post
mkaand
Offline
mkaand's picture
Donator
Joined: 6 years
Last seen: 5 months
I think I messed my mono installation

Hello,

I am newbei for linux systems. I have RaspberryPi Zero. I try to install WebGrab++ on it but due to complicated and unclear mono installations I couldn't use WebGrab for HTTPS sites. First I try to install Hardware FLOAT and installing bianry mono mono_2_11_4_armv6hf_binary.tgz

Looks OK for HTTP websites but HTTPS it fails. Then I searched the forum and google. I found this is old way. I should install v5> mono. But I couldn't remove v2.11.4 mono. I found this one to get rid of mono:

sudo rm -rf usr/lib/mono /usr/local/bin/mono /usr/local/etc/mono /usr/local/lib/mono

It works and I try to install mono package with this:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF echo "deb http://download.mono-project.com/repo/debian raspbianjessie main" | sudo tee /etc/apt/sources.list.d/mono-official.list sudo apt-get update

sudo apt-get install mono-complete

After that I start recieving Auth Error for HTTPS sites. I try to check HTTPS Request with these:

mcs tlstest.cs /r:System.dll /r:Mono.Security.dll

mono tlstest.exe https://www.nuget.org

But it says mono not found \blah\blah\path but if type mono -V

I see mono installed. Looks like there are several version of mono. I couldn't find good tutorial for step by step guide for actual WebGrab and actual Mono. I think I will go back to Windows and blackbear's php way. No good tutorial. I tried everything. Can someone help me?

mkaand
Offline
mkaand's picture
Donator
Joined: 6 years
Last seen: 5 months

Maybe this informations help to find out what is wrong, I tried to test mono hello.cs file:

pi@raspberrypi:~ $ ls
Desktop    hello.cs                        Pictures      Templates    Videos
Documents  mono_2_11_4_armv6hf_binary.tgz  Public        tlstest.cs   WebGrabPlus_V2.1_install.tar.gz
Downloads  Music                           python_games  tlstest.exe
pi@raspberrypi:~ $ mcs hello.cs
/usr/local/bin/mcs: 2: exec: /usr/local/bin/mono: not found
pi@raspberrypi:~ $ which mono
/usr/bin/mono
pi@raspberrypi:~ $ 

and mono -V results:

pi@raspberrypi:~ $ mono -V

Mono JIT compiler version 5.2.0.215 (tarball Mon Aug 14 16:59:51 UTC 2017)

Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com

TLS:           __thread

SIGSEGV:       normal

Notifications: epoll

Architecture:  armel,vfp+hard

Disabled:      none

Misc:          softdebug 

LLVM:          supported, not enabled.

GC:            sgen (concurrent by default)

pi@raspberrypi:~ $ 

mkaand
Offline
mkaand's picture
Donator
Joined: 6 years
Last seen: 5 months

I do not recommended to follow installation of old mono (v2.11) it messes your system.I deleted all files related with mono manually. And find a trcik on this website: https://askubuntu.com/questions/390592/how-add-mono-to-my-path

To be able to do that, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo nano ~/.profile

And add the following line:

export PATH=path_of_mono:$PATH

Replace path_of_mono with the correct path of mono.

For me mono was /usr/bin/mono (I found that after installing lates mono package. I uninstalled mono couple of times and I installed complete package.

I followed TLS 1.2 Support guide: http://www.mono-project.com/docs/about-mono/releases/4.8.0/#tls-12-support

Now I can able to use mcs and mono commands. I generated tlstest.exe and results are weird I think the website has problem. https://www.dsmart.com.tr

Here is the results

pi@raspberrypi:~ $ mono tlstest.exe https://www.nuget.org

https://www.nuget.org
pi@raspberrypi:~ $ mono tlstest.exe https://www.dsmart.com.tr

https://www.dsmart.com.tr
FAILED: #-2146232800
System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: Error while sending TLS Alert (Fatal:InternalError): System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. ---> System.Net.Sockets.SocketException: Connection reset by peer
  at System.Net.Sockets.Socket.EndReceive (System.IAsyncResult asyncResult) [0x00012] in <30b06929a39a4cd2a4ccaa70b756ffa0>:0 
  at System.Net.Sockets.NetworkStream.EndRead (System.IAsyncResult asyncResult) [0x00057] in <30b06929a39a4cd2a4ccaa70b756ffa0>:0 
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.RecordProtocol.EndReceiveRecord (System.IAsyncResult asyncResult) [0x00037] in <d74853bc825444959b20ae5c72884af0>:0 
  at Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord (System.IAsyncResult ar, System.Boolean ignoreEmpty) [0x00000] in <d74853bc825444959b20ae5c72884af0>:0 
  at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (System.IAsyncResult result) [0x00071] in <d74853bc825444959b20ae5c72884af0>:0 
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (System.IAsyncResult result) [0x00032] in <d74853bc825444959b20ae5c72884af0>:0 
  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (System.IAsyncResult asyncResult) [0x0000c] in <d74853bc825444959b20ae5c72884af0>:0  ---> System.IO.IOException: Unable to write data to the transport connection: The socket is not connected. ---> System.Net.Sockets.SocketException: The socket is not connected
  at System.Net.Sockets.Socket.BeginSend (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags, System.AsyncCallback callback, System.Object state) [0x00022] in <30b06929a39a4cd2a4ccaa70b756ffa0>:0 
  at System.Net.Sockets.NetworkStream.BeginWrite (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.AsyncCallback callback, System.Object state) [0x0009b] in <30b06929a39a4cd2a4ccaa70b756ffa0>:0 
   --- End of inner exception stack trace ---
  at System.Net.Sockets.NetworkStream.BeginWrite (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.AsyncCallback callback, System.Object state) [0x000e6] in <30b06929a39a4cd2a4ccaa70b756ffa0>:0 
  at Mono.Security.Protocol.Tls.RecordProtocol.BeginSendRecord (Mono.Security.Protocol.Tls.ContentType contentType, System.Byte[] recordData, System.AsyncCallback callback, System.Object state) [0x00023] in <d74853bc825444959b20ae5c72884af0>:0 
  at Mono.Security.Protocol.Tls.RecordProtocol.SendRecord (Mono.Security.Protocol.Tls.ContentType contentType, System.Byte[] recordData) [0x00000] in <d74853bc825444959b20ae5c72884af0>:0 
  at Mono.Security.Protocol.Tls.RecordProtocol.SendAlert (Mono.Security.Protocol.Tls.Alert alert) [0x00021] in <d74853bc825444959b20ae5c72884af0>:0 
  at Mono.Security.Protocol.Tls.RecordProtocol.SendAlert (System.Exception& ex) [0x0001b] in <d74853bc825444959b20ae5c72884af0>:0 
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslStreamBase.EndNegotiateHandshake (Mono.Security.Protocol.Tls.SslStreamBase+InternalAsyncResult asyncResult) [0x00022] in <d74853bc825444959b20ae5c72884af0>:0 
  at Mono.Security.Protocol.Tls.SslStreamBase.NegotiateHandshake () [0x0002b] in <d74853bc825444959b20ae5c72884af0>:0 
  at Mono.Security.Protocol.Tls.SslStreamBase.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x00064] in <d74853bc825444959b20ae5c72884af0>:0 
  at System.IO.StreamWriter.Flush (System.Boolean flushStream, System.Boolean flushEncoder) [0x0007e] in <c109e83bf6b6427c945b56620bfa750d>:0 
  at System.IO.StreamWriter.Flush () [0x00006] in <c109e83bf6b6427c945b56620bfa750d>:0 
  at TlsTest.GetStreamPage (System.String url) [0x000c2] in <7ad9caa5280c42fa9e47b5cc3d9b1e0e>:0 
  at TlsTest.Main (System.String[] args) [0x002aa] in <7ad9caa5280c42fa9e47b5cc3d9b1e0e>:0 

So I decided to use BlackBear's php file. Still good option for dsmart.com.tr Mono choosing websites and it is not stable.

mkaand
Offline
mkaand's picture
Donator
Joined: 6 years
Last seen: 5 months

Currently I use your php for https://www.dsmart.com.tr Looks like this is the only way for this website. Could you check and confirm? Currently I installed latest mono package. Mono working properly but I don't think it will work for dsmart. 

mkaand
Offline
mkaand's picture
Donator
Joined: 6 years
Last seen: 5 months

Your php working OK with DSMART on RPI. But still needs to fix ini file (You know the problem)

2017_08_29_18_08_51

mkaand
Offline
mkaand's picture
Donator
Joined: 6 years
Last seen: 5 months
Blackbear199 wrote:

i do not use php file for any https sites anymore(including dsmart) on linux and i'm using mono > 5.0.1 on linux mint(ubuntu based).

What's the difference between your configuration and my configuration? I use RaspberryPi. Here is the mono:

2017_08_29_18_11_28

Could you check this commands on your system? Thanks.

You can confirm this by using the tlstest tool (needs Mono >= 3.4.0). It prints an error if something is wrong.

mcs tlstest.cs /r:System.dll /r:Mono.Security.dll
mono tlstest.exe https://www.dsmart.com.tr
mkaand
Offline
mkaand's picture
Donator
Joined: 6 years
Last seen: 5 months

So Raspberry and your system totally different. I can confirm that with latest mono some HTTPS sites doesn't work. And your PHP solution is the only solution for RPI.

mkaand
Offline
mkaand's picture
Donator
Joined: 6 years
Last seen: 5 months

Yes, I did. mono-complete

Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl