NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Wolfgang Orth

Pages: 1 2 [3] 4 5 ... 17
31
FWIW, Wolfgang, I think the easiest way to be sure you have the right DLLs and VS runtime is just to run openssl.exe and see if you get an error message.

The compile process should copy the current version of openssl.exe into your app folder.

Jane

Great tip! OpenSSL says, it is missing VCRUNTIME140.dll. This seems to be a  Visual C++ Redistributable Package for Visual Studio 2015.

https://www.microsoft.com/en-us/download/details.aspx?id=48145

microsoft offers vc_redist.x86.exe and vc_redist.x64.exe. I take both!

I have the x64 version of Windows 10 running on my development machine, but since Clarion programs are still Win32, I suppose I need that one to distribute.

Lets see what happens.....

<a few moments later....>

Ha! That did the trick!

However, I did not need to install that redist-package, because I found it already on my HDD.

I did a
C:\>dir vcruntime140.dll /S /B

and found these two critter:

C:\Program Files (x86)\Mozilla Firefox\vcruntime140.dll
C:\Users\Wolfgang\AppData\Local\Microsoft\OneDrive\19.174.0902.0013\vcruntime140.dll

Now I copied the OneDrive one to my EXE-folder, OpenSSL is not complaining and so does my own server. It runs smoothly, as it seems.

I assume, that I have to distribute this VCRUNTIME140.dll now also. Its just 78 kB, it does not hurt.

Thanks you so much, Jane!

Ooops, I was happy too early!

"SSL_ERROR_NO_CYPHER_OVERLAP"

back to digging

I remember that Bruce mentioned to have changed (disabled) some SSL-methods. I think he said this during a webinar. Now to find that one.

Maybe I need to re-issue my own certificate.

This is the very same webserver, made with NT 9: https://5.175.18.216:51443/

That is said about the code-signing algotithm: "PKCS #1 SHA-256 mit RSA-Verschlüsselung"

It looks up-to-date, doesn't it?

32
Web Server - Ask For Help / Re: Two big problems in NT 11 - at least for me
« on: November 10, 2019, 12:56:53 AM »

I've cloned that into two identical services, one listening on port 80 and the other on 443 (with a wildcard certificate for our local domain).


Yes, that is the way to go. And both services can monitor each other in case for being down accidently.

I need the insecure server for returning an HTML-page, that gets displayed with FileExplorer (=> IE) inside my Clarion fat-client. Getting a certificate warning for the user every time is so eeewwwwww!
And I can't rely on the IT-stuff to accept my shitty certificate. So we have to muddle behind the scenes.

Cloning is not that huge problem, because the source for these two purposes (my generated HTML and sometimes a PDF) will not be part or the secure server, so there is no duplicate code to maintain in the furture. Anything else I would file under nightmare.

Thanks, Jane!


33
Web Server - Ask For Help / Re: Two big problems in NT 11 - at least for me
« on: November 10, 2019, 12:48:44 AM »

This effectively allows you to run two serves one for 80 and one for 443 (and disabling the other "built-in" server), without the two trying to interact.


Yes, that will be the way.

And the benfit of this solution is, that both services can monitor each other for being down accidently.

Thanks, Bill!

34

The second problem is this:

When the converted server starts, I get the following entry in the log:

ERROR: -73 Unable to Listen on TCP Port 443 SSL Could Not Load TLS DLLs [Could not load the TLS DLLs - libssl-1_1.dll, libcrypto-1_1.dll, msvcr120.dll]

In the docs for Nettalk 10 I read this:
https://mirror.capesoft.com/docs/NetTalk10/NetTalkWebSecure.htm#Troubleshooting

ANd this is the link to the docs of Nettalk 11, not mentioning MSVCR120:
https://mirror.capesoft.com/docs/NetTalk11/NetTalkWebSecure.htm#Troubleshooting

Anyway, all three files are sitting right next to the EXE. So why does the EXE do not see them?

What do I have to do to fix that?

btw, I am on Windows 10 1903, so I guess I already have the Visual Studio 2017 (x86) runtime. (Have not checked it by now, will do tomorrow)

Thanks for any attention so far
Wolfgang

35
Web Server - Ask For Help / Two big problems in NT 11 - at least for me
« on: November 09, 2019, 10:45:32 AM »
Hello Bruce,

finally I am in the process to upgrade my major programs from Clarion 10 / Nettalk 9 to the most recent Clarion 11 / Nettalk 11. I am aware that there will be some work with chanking all the webclients, but before getting there, I ran into two other problems.

The communication between my clioent and server has (mostly) to be encrypted. And because the customers are hospitals, they might run my program in an isolated, "air-gapped" LAN. Hence I have to issue a self-signed certificate for the webserver. Which is fine so far, because the user works with a Clarion-written fat-client, where I can suppress the errors about this not-so-valid certificate.

Unfortunately there are two occasions I have to serve data on the regular insecure port (defaults to 80). In Nettalk 9 I was able to have my program running two webservers. That worked great!

The reason why I had to have that insecure webserver was, that they would be forced to add my self-issued certificate in their web of trust, to avoid warnings when the two occasions happen, as mentioned before. So it was prerfect for all participants.

While the secure server had a CSL set, the insecure one did not. Otherwise each thime a MESSAGE() pops up, telling that the connection is insecure. Not good for a server when running as a service.

Code: [Select]
"It will thus be necessary to remove the second object
in the WebServer procedure, and just set the two port numbers
for the primary object correctly."

https://www.capesoft.com/docs/NetTalk10/NetTalk10Upgrade.htm#ListeningOn2Ports

Unfortunately this is not possible for me!

Is there any way to sneak around this problem?

Because it is not a good idea to put two probably unrelated problems into one posting, I stop here and wtite a second post.


36
Web Server - Ask For Help / Re: cURL - FileUpload to a NT-(SOAP)Server
« on: September 08, 2019, 11:15:12 PM »

In the generated documentation for the service ??


Ahhh, yes, maybe this is what Bruce meant!

However, I am locked in Nettalk 9 right now, so I did not notice that. I will inspect this an report later.

Thanks, Jane!

37
Web Server - Ask For Help / Re: WebService Response
« on: September 06, 2019, 07:10:17 AM »
It is a requeriment from an ATM system to validate the credit of a client.
Will try if they accept a dot at the end.

Alberto,

in HTML there is a "non-breaking space" to force a space character.
This in needed sometimes, like >                       < here because the browser reduces the number of spaces between two characters, like between two words, no matter how many spaces you have added into your source.

For this &nbsp; is used. It has its equivalent on &#160; and perhaps it could work for you by filling the end of your string with this garbage?

This is it how the line above looks like, what the browser returns:
This in needed sometimes, like &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt; here because.......


Just a wild guess from me.....
Wolfgang

38
Web Server - Ask For Help / Re: cURL - FileUpload to a NT-(SOAP)Server
« on: September 06, 2019, 06:56:12 AM »
the best part is that if you use a NetWebServiceMethod it'll come with a CURL example already in the docs for you. !

Hmmm, where is that?

I did a grep and all I found was the Multisite- and PHP-example. One fined was calcUrl, the other was php_curl.dll.

Anyway, I got it working instantly, once I followed you advice, to set the type to FILE and use the proper fieldname. Works like a charm! Everything from TXT to ZIP or JPG got send to and stored on the server.

However....

I expanded the cURL-commandline with a second parameter, a Description-field about the file, that gets uploaded.

curl -F "IncomingFile=@g:\cURL\yaddayadda.txt;type=multipart/form-data" -F "Description=Yadda Yadda" http://192.168.178.113:88/FileUpload

Still all perfect! Except the fact, that if the contents of "Description" or the name of the "IncomingFile" contains special characters like german umlauts as äöü or ÄÖÜ or ß, which is quite probably to happen. Well, I am a bit confused about what happens when, because it all looks so weird to me. I took some screenshots to explain, what happens when.

The first image is the cURL command itself. I created a TXT with the name rübärö.txt and take just that for the "Description" as well, to make things obious.

The second image shows the incoming POST in the server. The filename has been received correctly (while the contents is displayed wrong, ought to be "kurz und bündig!", but finally gets stored correct, both filename and contents, so no problem here). The contents of "Description", which is just as the filename itself, is displayed correct.

When the file is stored successfully (or not), I return the result to the client. For this I extract the filename, using StringTheory .FileNameOnly() and take this + the Description, stuff it into a variable and send this variable back. As seen in image three. I use the output into DebugView to display this. Cunningly the name of the file is correct here, while assigning to the variable. The description is already broken. All umluats are turned to ?. But it gets weirder! The next line, which starts with [st], comes directly from StringTheory. (I have checked debunggin on in the Template.) These four lines are actually what gets sent, and the umlauts are changed to some higgeldy-piggeldy, but very different to the ? in the Description.

But it still gets better. Image four shows the incoming on the client-side, where it has turned into gobbledygoo.

Something is going on here, but I do not what and where. And because I do not believe in sorcery, there mut be a reason. A very well hidden reason. I have some guesses, but those guesses I tried were all proven wrong.

If it would be helpful I could pass this APP in for the next webinar.

Thanks for all your patience
Wolfgang


39
Web Server - Ask For Help / Re: cURL - FileUpload to a NT-(SOAP)Server
« on: September 06, 2019, 06:11:40 AM »
Matthew,

using a NetServiceMethod is actually dead simple. If you do not the mistakes I did. ;-)

Once Bruce pointed me to the missing bits, it worked instantly!

Yet I ran into another problem, see my other post.

Thanks for your input!

40
Web Server - Ask For Help / cURL - FileUpload to a NT-(SOAP)Server
« on: September 05, 2019, 05:32:39 AM »
Hello Bruce and all others,

the plan is to automatically upload files via cURL to a Nettalk-Webserver. NT v10.25 with StringTheory 3

From one of the previous webinars I understood, that a SOAP-Server would suit best for this. However, I do not get it going. :-(

I see the incoming request, but the incoming data are completly empty. In the .PrimeParameter-Method I placed
dbgView(p_web.GetValue('IncomingFile'))
to get shown the contents of the incoming data. In my test I send a TXT.

First I tried
curl -T "g:\cURL\manual.txt" http://192.168.178.113:88/FileUpload
which appears in the logging like


PUT /FileUpload HTTP/1.1
Host: 192.168.178.113:88
User-Agent: curl/7.55.1
Accept: */*
Content-Length: 12206
Expect: 100-continue

This is the Manual bla bla bla...

.... and here comes the text of the sent file.

Then I tried (beside many variations)
curl -F "manual=@g:\cURL\manual.txt;type=multipart/form-data" http://192.168.178.113:88/FileUpload
is in the logging of the server like

POST /FileUpload HTTP/1.1
Host: 192.168.178.113:88
User-Agent: curl/7.55.1
Accept: */*
Content-Length: 12455
Expect: 100-continue
Content-Type: multipart/form-data; boundary=------------------------cb39bf6890b52e75

--------------------------cb39bf6890b52e75
Content-Disposition: form-data; name="manual"; filename="manual.txt"
Content-Type: multipart/form-data

This is the Manual bla bla bla...

etc etc etc

So, its in there, but not in p_web.GetValue('IncomingFile') and therefore my attempt to save the file in the .ServiceMethod
IncomingFile.SaveFile(ThisProgram.EXEPath() & 'web\uploads\mimimi.txt')
results in an empty file "mimimi.txt"

DebugView returns this:

*** excerpt copied from DebugView ****

[st] [netTalk][thread=3] FileUpload START Event=
(in this line contents ought to appear from dbgView() in .PrimeParameters, but that string is empty)
[st] [netTalk][thread=3] Incoming Parameters Format: xml=0 ; json=0
[st] [netTalk][thread=3] IncomingFile =  .....


*** /excerpt copied from DebugView ****

What am I missing?

Or should I better tinker a FORM for such upload? Maybe because POST expects a FORM? Which then would lead to the question, how a FORM has to look like. But one step after the other. And there seem to exist some FORMs in the examples.

Thanks in advance!
Wolfgang

41
Web Server - Ask For Help / MAC-address Vendor
« on: June 23, 2019, 02:29:13 AM »
Hello all,

in my SOAP-Server I store the Computername and the MAC-Address for some significant reason (explanation below). Now I noticed, that one computername is listed twice in my database, with two different MAC-Addresses. One MAC-Address is apparently from an Intel-NIC. The other, differening only in the first and the last byte, is completely unknown, seems to have no vendor. *)

I also see, that this desktop-name is used from the same public IP-Address. That lets me assume to be the the identical computer. But how can it be, that this PC has a valid MAC-Address on one day, a different, "invalid" one the next day?

Does anyone know more about this? Could it be a virtual machine with revolving MACs?

The significant reason explained: This SOAP-Client-Server-combo is meant to be used inside a LAN. On first contact between client and server, the computername and its MAC-Address get joined with the department the user selects from a list, then gets stored in the DB. Now we can make a machine log-in, we can avoid a user log-in. Its meant for convenience. Computername + MAC-Address have to be unique.
I know these data, because they appeared in the DB of my publicly available demo. However, its an anonymous demo, there is no chance to get a hold on that person and ask directly.
The ISP-issued IP-address, from where the computer got connected to my server, was the same over several days, albeit the number seems to not come from a pool of static addresses. Normally ISP's disconnect every 24 hours, so every day a normal, private customer gets a new one. Which private user runs virtual machines? But it is also not recognizable, whether the IP-Address is issued to a company. It seems to be a pool of dynamic addresses. And corporations have their own address-blocks.

Thank you for your patience - and for any input!
Wolfgang


*) The IEEE issues a  24 Bit identifier to vendors, the Organizationally Unique Identifier (OUI). The vendors normally use this as the first three bytes in the MAC-Address.
https://standards.ieee.org/products-services/regauth/oui/index.html

42
Web Server - Ask For Help / Redirect a virtual URL to a file
« on: May 31, 2019, 02:43:58 AM »
Hello Bruce, Stu, any other!

In an older thread from 2016, Stu asked about how to redirect a request from "www" to "root".

When I wanted to hook into that thread with my question, the forum-soft suggested to start a new topic, due to the age of the original thread. So here it goes:

I think I want something very similar like Stu did. I have a .ZIP sitting somewhere in the .\web-directory. This files is meant to be sort of invisible., It should be accessible only, when you are a customer. But we want to avoid to force the user to type a password to verify against his. Folks are not endurable nowadays, all must be made as easy as possibly. I personally like comfort also.

So the idea is, to send out a unique, however not existing URL to each customer, with a specific string or token or whatever it is called, being part of this URL.
Like
https://theserver.com/123ABC/update.zip
https://theserver.com/qwer99/update.zip
https://theserver.com/UhT432/update.zip

and each url will return the same update.zip. Those inserted tokens will probably based in the customers name, with all spaces removed. Plus a numeric part as a sort of increment for further uses. Have to be unique, though.

Bruce wrote in 2016 in an answer to Stu:
-------------------------------------------------------------
so the call is

p_web.Redirect(toURL)

I think the best place for it is in WebHandler, _SendFile, after loc:filename is set...
something along the lines of

  if lower(sub(loc:filename,1,3)) = 'www'
    self.redirect....
    return
  end

-------------------------------------------------------------

My question: does this SELF.Redirect() have to have the EXACT address of the file in that toURL-parameter?

First I tried SELF.Redirect('update.zip'), because it sits in the .\web-directory, but it turned into error -34, Error sending data NetSimple.Send. Same with '.\update.zip'. It now works with the exact URL of the ZIP.

Thats okay for me. I just wanted to know, whether I made a mistake on my side or whether this is intended.

I can read a value for this toURL string from an .INI, for pointing to the most recent .ZIP.

[UPDATE]
It seems as if SELF.Redirect('/filename.zip', 1) is working now.




Bonus question: Is it okay to put some data-access into this embed p_web._sendFile() before Parent?

I need to veriy this unique token per customer to verify and also log to a file or send via mail, who already downloaded his / her file.

Or do I misuse the wrong embed here, need to do that somewhere else?

At the moment I ask for Nettalk 10. The upgrade in in the works, but .. yes, it will come - later.


thanks
Wolfgang

43
Wolfgang,

That can work well.
I also have some apps that just check a server for a "master timestamp" to determine whether any updates are available.

This can be done by polling or have the timestamp pushed by web socket.

Jane

Hello Jane,

unfortunately I am still with Nettalk 9, eagerly waiting to upgrade. So, Websockets are no option right now, but I have a kind of permanent communication between, so I can get that information to all clients in a timely manner. Its not up to the second, but its not really time-critical.

My real problem is, that I will have that to be replaced table opened by two procedures on the client-side. The App-Frame now will know about an updated MEMORY-table, but (from my understanding) it needs an OPEN(table, ReadWrite + DenyAll) for replacement.

So, this is my plan (for now): Once the App-Frame has learned from differening timestamps, that a new table is loaded on the server-side, I will display in some friendly bold green letters, that the user is invited to restart the client-program, to obtain the latest and most recent product list. This will be a save and convenient way to get this update done.

Lets see, what Bruce will tell me about NetRefresh during the next webinar.

Enjoy the Easterbunny! :-)

bye
Wolfgang

44
Hi Wolfgang,
It seems like you have 2 different information sources -
1. Drugs
2. Homebrew drugs

We use NDC codes to identify each drug - this is often a good starting point to identify drugs.
Homebrew drugs do not have an NDC code.

Hello Ron,

thank you a lot for your input, it was very valuable!

At first I was intrigued to reply to every single line you wrote, but then I thought, that this might become a very boring thing for all.

Just two things:

Yes, we have an equivalent to NCD, its Pharmazentralnummer PZN. And a second yes, that those homebrew product will likely have no NCD / PZN. However, we need one. So we demand one. If none available, I will simple put an 8-char GUID into the appropriate field during import as a bogus NCD / PZN. This will not hurt, because it it used nowhere else but in this prograam.

The second thing: Timestamp! Yessss!

I will simply store the timestamp from that very moment of a modification by the pharmacy. So the only data I have to request then is this single value, not the entire table. My Client.exe (no browser-based app here [yet]) communicates permanetly with the server on the AppFrame-thread. So once my client learns, that there is a modfied timestamp, it will then display a ?STRING or ?PROMPT on the TOOLBAR, saying that there is "a new drug-list available - after a re-start of this EXE" or some similar wording.

This will be flexible enough! Because this modification is not really time-critical.

Your reply has helped me a lot to sort out my thoughts. Very appreciated!

Thanks again
Wolfgang


45
Hello Bruce and all,

this is a strategic matter I am chewing on.

At startup the webserver reads a Product.TPS into a MEMORY-table.
When the Webclients (Clarion/NT-programs) start, they download this
entire table for the use during its work. This table is completely used
for read-only on the client-side.

Now someone on the server-side will have a program
(likely Clarion/NT-made web-client also) to modify this table.
Think if a complete replacement of table.
(Skipable details: The .TPS is a list of drugs.
The pharmacist can flag products, which are in stock.
Nurses may toggle between ALL drugs / Recently available drugs.
No product is purged, they are just flagged differently.
However, the pharmacy may produce their own nutrition solutions etc.
Those homebrew products are planned to be added to
our MEMORY-table of the drugs.
And those homebrew products can be replaced / removed.
Not on a daily base, but this homebrew-fraction of the table is volatile. /skip)

From this moment on, the data on the client-side are different from those on the server-side.

How do I update this MEMORY-table on the client-side?
The client-user may have one or two procedure open,
where this MEMORY-table is in use. I would not want to
drag away the chair they are sitting on.

One idea I had was to signal on the client-side with a
floating WinEvent-message bottom right-hand corner, saying
"Please close this MDI-Child, a new drug list is lingering for an update".
There is a  good chance that this message is ignored or misunderstood.

A focus-grabbing MESSAGE() is no option. (How about CS Messagebox()?)

Alternatively I could wait for the MDI-child to be closed, then quickly
request and download that modified list. But my program has two
different procedures, both using this same MEMORY-table.
So closing one would not help much, if the second remains open.

One other idea I have to keep the homebrew products separated from
the general druglist. This would be a tiny list, which could easily be sent
each time a procedure opens. But whatever I do, it seems to be the
same problems as with disconnected apps.

How is this solved with "Disconnected Apps"?

Actually I see two questions:
How to solve this technically and how to treat the user?

Thanks you very much for your patience to read all this lament.
Wolfgang

Pages: 1 2 [3] 4 5 ... 17